changeset 16718:044260623695

makes demux_lavf (-demuxer 35) use the framerate specified in the container if it's set and only fall back to the codec framerate if the former is not set. This solves the issue of some avi's playing at 30000/1 fps instead of the correct framerate. Patch by Ivo < ivop AH euronet POIS nl > Original thread: Date: Sep 25, 2005 12:34 AM Subject: [MPlayer-dev-eng] [PATCH] make demux_lavf use container framerate
author gpoirier
date Mon, 10 Oct 2005 05:45:38 +0000
parents 9c80148c5a4d
children 2acb2b765197
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sun Oct 09 19:26:23 2005 +0000
+++ b/libmpdemux/demux_lavf.c	Mon Oct 10 05:45:38 2005 +0000
@@ -259,6 +259,10 @@
             sh_video->bih= bih;
             sh_video->disp_w= codec->width;
             sh_video->disp_h= codec->height;
+            if (st->time_base.den) { /* if container has time_base, use that */
+                sh_video->video.dwRate= st->time_base.den;
+                sh_video->video.dwScale= st->time_base.num;
+            } else {
 #if LIBAVFORMAT_BUILD >= 4624
             sh_video->video.dwRate= codec->time_base.den;
             sh_video->video.dwScale= codec->time_base.num;
@@ -266,6 +270,7 @@
             sh_video->video.dwRate= codec->frame_rate;
             sh_video->video.dwScale= codec->frame_rate_base;
 #endif
+            }
             sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
             sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
             sh_video->format = bih->biCompression;