[MPlayer-dev-eng] [PATCH] stream_cdda seek to end fix

Ulion ulion2002 at gmail.com
Fri Dec 14 09:26:50 CET 2007


2007/12/13, Ulion <ulion2002 at gmail.com>:
> 2007/12/12, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > Hello,
> > On Wed, Dec 12, 2007 at 09:17:05PM +0800, Ulion wrote:
> > > It seems rare people use mplayer to play cd, stream_cdda can not even
> > > seek to end, it hangs with 'Track 1' printed in verbose output,
> > > indeed, that's the default value of variable seeked_track, but sector
> > > is already out of tha end_sector. Here's a patch for it.
> >
> > Shouldn't it better instead handle the seek error properly? If it hangs
> > like this I'd assume it will hang the same way e.g. with a scratched
> > CD..
> > And even if this is the best solution, preferably any code that can
> > cause hangs should be eliminated (I have a similar problem with the TV
> > code, if the reception is bad MPlayer can hang for several minutes
> > before reacting to input, though some of it might be because (AFAICT)
> > simply all TV-related kernel-drivers are full of bugs).
>
> Even you can set a seek position out side of [start_sector,
> end_sector], it won't do any help, check fill_buffer() in line 374
>
>   if((p->sector < p->start_sector) || (p->sector >= p->end_sector)) {
>     s->eof = 1;
>     return 0;
>   }
>
> the fill_buffer() function does not ready for reading out size the
> sector range, that's what my patch check range in seek(). So it's
> totally ok to set eof in seek when sector out of range in current
> code.
> If want the feature can seek out of range, you need write a patch to
> support set end_sector or start_sector by command line options.
>
> So I will apply this patch tomorrow if there's no objection.

Commited.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list