diff options
author | corey <corey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-20 09:36:10 +0000 |
---|---|---|
committer | corey <corey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-20 09:36:10 +0000 |
commit | 6f446f41b599af7b4630d6e3ca0bc7285d7c8a62 (patch) | |
tree | 06724f51ed9368c59f78b092579b3afc755e9b2a | |
parent | 362b6d13dd77b1f8d61e5436b96fa0ea51eb27ca (diff) | |
download | mpv-6f446f41b599af7b4630d6e3ca0bc7285d7c8a62.tar.bz2 mpv-6f446f41b599af7b4630d6e3ca0bc7285d7c8a62.tar.xz |
New option: -ignore-start
Makes mplayer and mencoder ignore dwStart in AVI files.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17655 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | DOCS/man/en/mplayer.1 | 12 | ||||
-rw-r--r-- | cfg-common.h | 4 | ||||
-rw-r--r-- | mencoder.c | 3 | ||||
-rw-r--r-- | mplayer.c | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 5a243f8ff9..14473481e1 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1101,6 +1101,18 @@ When used with MEncoder, this is not guaranteed to work correctly with \-ovc copy; use \-audio-delay instead. . .TP +.B \-ignore-start +Ignore the specified starting time for streams in AVI files. +In MPlayer, this nullifies stream delays in files encoded with +the \-audio-delay option. +During encoding, this option prevents MEncoder from transferring +original stream start times to the new file; the \-audio-delay option is +not affected. +Note that MEncoder sometimes adjusts stream starting times +automatically to compensate for anticipated decoding delays, so don't +use this option for encoding without testing it first. +. +.TP .B \-demuxer <[+]name> Force demuxer type. Use a '+' before the name to force it, this will skip some checks! diff --git a/cfg-common.h b/cfg-common.h index 599b5aabb5..ad78a98ba8 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -150,6 +150,10 @@ // set a-v distance {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL}, + // ignore header-specified delay (dwStart) + {"ignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + #ifdef USE_LIBA52 {"a52drc", &a52_drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL}, #endif diff --git a/mencoder.c b/mencoder.c index 167f5567a2..fb5e9fb489 100644 --- a/mencoder.c +++ b/mencoder.c @@ -156,6 +156,7 @@ static float c_total=0; static float audio_preload=0.5; static float audio_delay_fix=0.0; static float audio_delay=0.0; +static int ignore_start=0; static int audio_density=2; float force_fps=0; @@ -866,6 +867,7 @@ if ((force_fourcc != NULL) && (strlen(force_fourcc) >= 4)) mux_v->bih->biCompression, (char *)&mux_v->bih->biCompression); } +if (! ignore_start) muxer->audio_delay_fix -= sh_video->stream_delay; //if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf! @@ -961,6 +963,7 @@ case ACODEC_COPY: if (verbose>1) print_wave_header(mux_a->wf); +if (! ignore_start) muxer->audio_delay_fix += sh_audio->stream_delay; } // if(sh_audio) @@ -294,6 +294,7 @@ static float default_max_pts_correction=-1;//0.01f; static float max_pts_correction=0;//default_max_pts_correction; static float c_total=0; float audio_delay=0; +static int ignore_start=0; static int softsleep=0; @@ -2524,9 +2525,11 @@ current_module="av_init"; if(sh_video){ sh_video->timer=0; + if (! ignore_start) audio_delay += sh_video->stream_delay; } if(sh_audio){ + if (! ignore_start) audio_delay -= sh_audio->stream_delay; sh_audio->delay=-audio_delay; } |