[MPlayer-dev-eng] [PATCH] changing fps + audiofile with ogm bug

Denes Sexty denes at achilles.elte.hu
Tue Jul 27 15:49:05 CEST 2004


 I tried to watch a movie with dubbed sound form a separate file, which
would need the movie to have other fps: 25 instead of 23.976
 However, if i use
mplayer movie.avi -audiofile dub.mp3 -fps 25
 this would still play the movie with fps=23.976, because in the main
 A-V sync loop v_pts is still framenumber/23.976, so mplayer tries
to play 25 frames, but A-V sync pulls it back to 23.976
 ( v_pts comes from the demuxer, which gets it form the file itself. (Am I
right here?))

 So i did a little patch which adds a new variable: old_fps
and in the A-V sync module corrects v_pts:
  v_pts*=old_fps/force_fps;

 This patch is not enough to solve the problem, because if the fps is
changed, seeking should be modified too.

+ BUG
when using
mplayer movie.ogm -audiofile dub.mp3
after seeking the sound starts from the beginning, not the position where
the video seeked.

Bye
denes


PATCH
--------------
--- mplayer.c	2004-07-27 15:06:28.000000000 +0200
+++ ../ide/MPlayer-20040727/mplayer.c	2004-07-25 02:33:32.000000000
+0200
@@ -275,7 +275,6 @@
 static int softsleep=0;

        float force_fps=0;
-       float old_fps;
 static int force_srate=0;
 static int audio_output_format=0;
        int frame_dropping=0; // option  0=no drop  1= drop vo  2= drop
decode
@@ -1537,7 +1536,6 @@

     /* need to set fps here for output encoders to pick it up in their
init */
     if(force_fps){
-      old_fps=sh_video->fps;
       sh_video->fps=force_fps;
       sh_video->frametime=1.0f/sh_video->fps;
     }
@@ -2345,8 +2343,6 @@
     }
     v_pts=sh_video ? sh_video->pts : d_video->pts;

-    if (force_fps) { v_pts*=old_fps/force_fps; }
-
       mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"### A:%8.3f (%8.3f)  V:%8.3f
A-V:%7.4f
\n",a_pts,a_pts-audio_delay-delay,v_pts,(a_pts-delay-audio_delay)-v_pts);

       if(delay_corrected){




More information about the MPlayer-dev-eng mailing list