[FFmpeg-cvslog] avformat/omadec: only compute timestamps based on bitrate if its set

Michael Niedermayer git at videolan.org
Sat Feb 7 21:37:58 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb  7 21:12:56 2015 +0100| [7c2fa13df9a6130b3f258c7513933cbdca2fe23b] | committer: Michael Niedermayer

avformat/omadec: only compute timestamps based on bitrate if its set

Fixes division by zero

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c2fa13df9a6130b3f258c7513933cbdca2fe23b
---

 libavformat/omadec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index b080055..6f3671b 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -430,7 +430,7 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     pkt->stream_index = 0;
 
-    if (pos > 0) {
+    if (pos > 0 && byte_rate > 0) {
         pkt->pts =
         pkt->dts = av_rescale(pos, st->time_base.den,
                               byte_rate * (int64_t)st->time_base.num);



More information about the ffmpeg-cvslog mailing list