[MPlayer-advusers] mplayer aborts with -nosound

Bob Bell b_mplayer at thebellsplace.com
Fri Feb 8 07:43:04 CET 2008


On Thu, Feb 07, 2008 at 09:25:34PM -0500, Bob Bell wrote:
> I'm seeing mplayer/mencoder abort early when seeking to point a little
> over halfway through large VOB files (ripped from a DVD by mplayer
> -dumpstream).
> 
> For mplayer, the following command works:
>     mplayer -ss 4000 /path/to/foobar.vob
> However, the following command immediately exits with "(End of file)":
>     mplayer -ss 4000 /path/to/foobar.vob -nosound

I tracked down the problem most of the way, though I don't know what to
do about it.

In demux_seek_mpg() there is a calculation for newpos.  Without
"-nosound", mpg_d->has_valid_timestamps is set to 1.  With "-nosound",
has_valid_timestamps is set to 0.  I'm not sure if this is to be
expected or not... I'm guessing it's because the audio might be used as
a guide when seeking in the file?

The difference is that in the former case "(demuxer->movi_end
- demuxer->movi_start) / mpg_d->first_to_final_pts_len" is used when
calculating newpos, while in the later case "sh_video->i_bps" is used.
For my VOB, once multiplied times a rel_seek_secs of 3307, this means
a difference between ~2271055046 and 4051736400.  The former value
appears much more accurate.

Note that the total movie length is 4050993152.  Therefore, when seeking
to second 3307, the calculated value is beyond the end of the file.  The
logic in the rest of demux_seek_mpg() appears to correct for an
inaccurate "guess".  However, if the "guess" is beyond the end of the
file, a number of the routines will print error messages and return
error statuses, and the guess will not be corrected.

I'm hoping you have a suggestion in how to rework the logic in
demux_seek_mpg() or otherwise modify mplayer to fix this problem.  Thank
you.

-- Bob

P.S. To get by for now, I made the following change.  I doubt it's
a good long-term approach, however.

--- libmpdemux/demux_mpg.c      (revision 25959)
+++ libmpdemux/demux_mpg.c      (working copy)
@@ -924,6 +924,8 @@
         else
           newpos+=sh_video->i_bps*rel_seek_secs;
     }
+    if (newpos > (demuxer->movi_end * 0.9))
+       newpos = (demuxer->movi_start + demuxer->movi_end) / 2;

     while (1) {
         if(newpos<demuxer->movi_start){



More information about the MPlayer-advusers mailing list