[MPlayer-dev-eng] Re: [PATCH] enable -ss option on wmv streams

Karl Bielefeldt ocs6e3d02 at sneakemail.com
Wed Feb 4 08:08:18 CET 2004


> > > > This patch enables the -ss option to cause a wmv stream to start at
> > > > the specified position instead of at the beginning when the stream is
> > > > first being opened.  I used snort to reverse engineer the solution and
> > > > I'm not sure that I solved it the best way, but it does work well for
> > > > my online classes.  As far as I can tell, there is no way to seek
> > > > after the stream has been already opened, so this works differently
> > > > than most seeking code I have seen in mplayer.  I welcome any
> > > > feedback.
> > > Someone familiar with that code?
> > 
> > Not that much but it seems ok. I'm wondering why the stream_time
> > variable is not a simple local inside the func. Also seek_to_sec is
> > a string option, so it must be freed otherwise that leak some mem.
> 
> Thanks for the feedback.  I had put the stream_time variable there
> during one of my initial debug versions and forgot to put it back for
> clean-up.  I have fixed that and freed the seek_to_sec variable in the
> attached revised patch.  I also did a cvs update to get a more recent
> baseline.  Please let me know if you have more comments.  Thanks.

My bad.  The stream_time variable is static for a reason.  The local
function can be called multiple times (I am not familiar enough with the
code to figure out why), and it is on the last time that the stream-time
parameter really matters.  The problem is that seek_to_sec needs to be
freed in order to prevent later code from trying to seek an unseekable
stream, but the stream_time that is stored in seek_to_sec in string form
needs to be saved for every time the function is called, just in case it
is needed.  The attached patch fixes that.  Again, I welcome any
feedback.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wmv_ss_patch-r3
Type: text/x-patch
Size: 2687 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040204/2d52efdc/attachment.bin>


More information about the MPlayer-dev-eng mailing list