summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authorcorey <corey@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-02-21 09:39:22 +0000
committercorey <corey@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-02-21 09:39:22 +0000
commit960b978a037702e3c684b66b6ab2cdd4d62c5162 (patch)
treeca292bc48860e8d135f9e1ef3bc1c10acf52e633 /mencoder.c
parent14d023a2ee8ccc35d0c0e46a8a9dc3da41328c9d (diff)
downloadmpv-960b978a037702e3c684b66b6ab2cdd4d62c5162.tar.bz2
mpv-960b978a037702e3c684b66b6ab2cdd4d62c5162.tar.xz
Fix video delay when encoding with B-frames.
Encoding delay is adjusted for on-the-fly during encoding. Decoding delay is compensated for by setting an appropriate dwStart on the audio stream (only in muxer_avi at this point). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17660 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mencoder.c b/mencoder.c
index fb5e9fb489..589c0422de 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -1394,6 +1394,9 @@ if(sh_audio && !demuxer2){
AV_delay-=audio_delay;
AV_delay /= playback_speed;
AV_delay-=mux_a->timer-(mux_v->timer-(v_timer_corr+v_pts_corr));
+ // adjust for encoder delays
+ AV_delay -= (float) mux_a->encoder_delay * mux_a->h.dwScale/mux_a->h.dwRate;
+ AV_delay += (float) mux_v->encoder_delay * mux_v->h.dwScale/mux_v->h.dwRate;
// compensate input video timer by av:
x=AV_delay*0.1f;
if(x<-max_pts_correction) x=-max_pts_correction; else