[MPlayer-dev-eng] Re: [PATCH] enable -ss option on wmv streams
Attila Kinali
attila at kinali.ch
Sat Jul 31 03:48:58 CEST 2004
On Wed, Feb 04, 2004 at 12:08:18AM -0700, Karl Bielefeldt wrote:
> > > > > 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.
What happend to this patch ?
Attila Kinali
More information about the MPlayer-dev-eng
mailing list