]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mp3dec: fix start time in light of initial skip samples
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Jan 2014 23:50:26 +0000 (00:50 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Jan 2014 00:05:16 +0000 (01:05 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mp3dec.c

index 5d484e9090d825f1d4bd535ec1de2029ce2c1dd6..c1ce17373777414144c2a16715b9ade6300041e1 100644 (file)
@@ -165,6 +165,10 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
             mp3->start_pad = v>>12;
             mp3->  end_pad = v&4095;
             st->skip_samples = mp3->start_pad + 528 + 1;
+            if (!st->start_time)
+                st->start_time = av_rescale_q(st->skip_samples,
+                                              (AVRational){1, c.sample_rate},
+                                              st->time_base);
             av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3->  end_pad);
         }
     }