summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-16 20:00:22 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-16 20:00:26 +0200
commit3574d34aca9dfac28d61bd783a7aa9b4c2d736f0 (patch)
tree673f10ac7180228bf19f7e173918e184b33add45
parent6928ea7eb0fbb12fa1d90075495fc910fbe16971 (diff)
parent51748b6377ff4032dea4d5d73d42ad9199c2366f (diff)
Merge remote-tracking branch 'cus/stable'
* cus/stable: mpegts: always parse pcr Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2d15a6a036..550af6f6d6 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -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;
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 */
p += p[0] + 1;
}
/* if past the end of packet, ignore */
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;
pos = avio_tell(ts->stream->pb);
@@ -2135,10 +2137,6 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
} else {
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.
if (tss->type == MPEGTS_PES) {
if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,