aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-18 22:10:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-18 22:45:39 +0200
commit0f2f65bd583576ef8c12eea6088c84d4468f5804 (patch)
treec69358dfb38f16cd6257eb6322748748678156bb
parentee7f2609a0dcac4008759f20ab9558a68d759821 (diff)
downloadffmpeg-0f2f65bd583576ef8c12eea6088c84d4468f5804.tar.gz
mpegts: fix pos47_full
The value was off by a packet Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 1213ecae46..9cff528dd3 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1862,7 +1862,8 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
return 0;
pos = avio_tell(ts->stream->pb);
- ts->pos47_full = pos;
+ av_assert0(pos >= TS_PACKET_SIZE);
+ ts->pos47_full = pos - TS_PACKET_SIZE;
if (tss->type == MPEGTS_SECTION) {
if (is_start) {
@@ -1910,7 +1911,7 @@ static void reanalyze(MpegTSContext *ts) {
int64_t pos = avio_tell(pb);
if(pos < 0)
return;
- pos += ts->raw_packet_size - ts->pos47_full;
+ pos -= ts->pos47_full;
if (pos == TS_PACKET_SIZE) {
ts->size_stat[0] ++;
} else if (pos == TS_DVHS_PACKET_SIZE) {