[FFmpeg-devel] assertions in aviobu.c while playing http stream
avcoder
ffmpeg
Tue Jul 20 11:40:05 CEST 2010
check my ooold mail on 2009/04/22
"
Dear:
Could we directly remove the "assert(s->buf_ptr == s->buf_end)" in
fill_buffer()?
If not,please check the following patch
Thanks
Index: aviobuf.c
===================================================================
--- aviobuf.c ??? 18659?
+++ aviobuf.c ??????
@@ -153,8 +153,11 @@
s->buf_ptr = s->buffer + offset1;
} else if(s->is_streamed && !s->write_flag &&
offset1 >= 0 && offset1 < (s->buf_end - s->buffer) + (1<<16)){
- while(s->pos < offset && !s->eof_reached)
+ while(s->pos < offset && !s->eof_reached){
+ /* skip the unused buffer,avoid assert() in fill_buffer() */
+ s->buf_ptr = s->buf_end;
fill_buffer(s);
+ }
if (s->eof_reached)
return AVERROR(EPIPE);
s->buf_ptr = s->buf_end + offset - s->pos;
"
The answer from Michael:
"
On Wed, Apr 22, 2009 at 05:12:36PM +0800, avcoder wrote:
> Dear:
> Could we directly remove the "assert(s->buf_ptr == s->buf_end)" in
> fill_buffer()?
probably yes, if its tested
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iD8DBQFJ7xiBYR7HhwQLD6sRAn1jAJ9C/t6yTOiIRenEu6x/6GppACNFtgCbBvfV
kWe8bEGHLNMvUPMuHUuOoOM=
=iYuk
-----END PGP SIGNATURE-----
"
On Tue, Jul 20, 2010 at 5:02 PM, Martin Storsj? <martin at martin.st> wrote:
> On Tue, 20 Jul 2010, Pavel Pavlov wrote:
>
>> I had some problems with http playback recently and I decided to run debug build of libavformat. It appears that because of recent changes it started to constantly assert inside:
>> I had the same problem if I tried to run debug build of ffplay
>>
>> static void fill_buffer(ByteIOContext *s)
>> ...
>> assert(s->buf_ptr == s->buf_end);
>
> Hmm, this assert in fill_buffer() does seem to be triggered by the "seek
> by reading forward" code (that was present long before my patch the other
> day, but only used for nonseekable streams). As far as I can see, it can
> be fixed in two ways:
>
> - Remove the assert from fill_buffer(), since we have another use case
> where that isn't true (also, reading the code of fill_buffer(), the assert
> doesn't really seem right)
> - Set s->buf_ptr = s->buf_end; before calling fill_buffer() in url_fseek
>
> Michael, which way do you think this should be fixed?
>
> // Martin
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
--
-----------------------------------------------------------------------------------------
My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2
More information about the ffmpeg-devel
mailing list