mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
mpegts: always parse pcr
Previously pcr transmitted without payload but as part of the video stream was not parsed. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
bddc592001
commit
51748b6377
@ -2073,16 +2073,18 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has_payload && tss->type != MPEGTS_PCR)
|
|
||||||
return 0;
|
|
||||||
p = packet + 4;
|
p = packet + 4;
|
||||||
if (has_adaptation) {
|
if (has_adaptation) {
|
||||||
|
int64_t pcr_h;
|
||||||
|
int pcr_l;
|
||||||
|
if (parse_pcr(&pcr_h, &pcr_l, packet) == 0)
|
||||||
|
tss->last_pcr = pcr_h * 300 + pcr_l;
|
||||||
/* skip adaptation field */
|
/* skip adaptation field */
|
||||||
p += p[0] + 1;
|
p += p[0] + 1;
|
||||||
}
|
}
|
||||||
/* if past the end of packet, ignore */
|
/* if past the end of packet, ignore */
|
||||||
p_end = packet + TS_PACKET_SIZE;
|
p_end = packet + TS_PACKET_SIZE;
|
||||||
if (p > p_end || (p == p_end && tss->type != MPEGTS_PCR))
|
if (p >= p_end || !has_payload)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pos = avio_tell(ts->stream->pb);
|
pos = avio_tell(ts->stream->pb);
|
||||||
@ -2135,10 +2137,6 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
int ret;
|
int ret;
|
||||||
int64_t pcr_h;
|
|
||||||
int pcr_l;
|
|
||||||
if (parse_pcr(&pcr_h, &pcr_l, packet) == 0)
|
|
||||||
tss->last_pcr = pcr_h * 300 + pcr_l;
|
|
||||||
// Note: The position here points actually behind the current packet.
|
// Note: The position here points actually behind the current packet.
|
||||||
if (tss->type == MPEGTS_PES) {
|
if (tss->type == MPEGTS_PES) {
|
||||||
if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,
|
if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,
|
||||||
|
Loading…
Reference in New Issue
Block a user