[FFmpeg-devel] [PATCH] avoid infinite loop when seeking flv and non seekable input

Michael Niedermayer michaelni
Thu Jul 31 13:12:44 CEST 2008


On Wed, Jul 30, 2008 at 07:24:41PM -0700, Baptiste Coudurier wrote:
> Baptiste Coudurier wrote:
> > Michael Niedermayer wrote:
> >>>> [...]
> >>>>
> >>>> This is not the correct solution i think.
> >>>> I think the code in the else below may be buggy when seek() fails, it can
> >>>> fail for non streamed things as well (network problems, old scratched cd...)
> >>>> I think moving 
> >>>>             s->buf_end = s->buffer;
> >>>>         }
> >>>>         s->buf_ptr = s->buffer;
> >>>>
> >>>> after
> >>>> if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
> >>>>             return res;
> >>>>
> >>>> might help ?
> >>>>
> >>> I see, it works but seek regression tests fail:
> >>> Patch and regression diff attached.
> >> hmm, i guess there are more bugs in the code that need to be fixed first.
> >> I would guess they are seeks that dont check the return value and previously
> >> failed due to the messed up internal byteio state.
> >>
> > 
> > Ok, I'll dig further.
> > 
> 
> I dig further and I found pcm_read_seek did not check url_fseek return
> value. Patch attached and with seek reg diff. What do you think of the
> diff ? It looks correct to me, ie returning -1 for negative timestamps
> in audio files only.
> 
> Also updated av_seek_frame_generic patch, I missed one call,
> av_seek_frame on image2 now return -22 (EINVAL) because ByteIOContext is
> not set, this is normal. I'll apply patches separately of course.
> 
> How does it look like ?

looks all good

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080731/14613ce6/attachment.pgp>



More information about the ffmpeg-devel mailing list