[MPlayer-cvslog] CVS: main/libmpdemux demux_lavf.c,1.21,1.22

Guillaume Poirier CVS syncmail at mplayerhq.hu
Mon Oct 10 07:45:40 CEST 2005


CVS change done by Guillaume Poirier CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv19738/libmpdemux

Modified Files:
	demux_lavf.c 
Log Message:
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


Index: demux_lavf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_lavf.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- demux_lavf.c	2 Sep 2005 08:32:32 -0000	1.21
+++ demux_lavf.c	10 Oct 2005 05:45:38 -0000	1.22
@@ -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;




More information about the MPlayer-cvslog mailing list