[Ffmpeg-devel] [PATCH] flv with streamed ByteIO support
nazo
lovesyao
Tue Sep 26 16:56:59 CEST 2006
michaelni at gmx.at wrote:
>> Index: libavformat/flvdec.c
>> ===================================================================
>> --- libavformat/flvdec.c (revision 6337)
>> +++ libavformat/flvdec.c (working copy)
>> @@ -157,8 +157,11 @@
>> url_fseek(&s->pb, next, SEEK_SET);
>> continue;
>> }
>> - if ((flags >> 4)==1)
>> + if ((flags >> 4)==1){
>> + if(url_is_streamed(&s->pb))
>> + st->codec_info_duration = s->duration; /* maybe found all streams */
>> av_add_index_entry(st, pos, pts, size, 0, AVINDEX_KEYFRAME);
>> + }
>
> this is a completely unaccpetable hack
> codec_info_duration is a lavf internal variable, demuxers must not touch it
ok. now the patch use flag
>> @@ -136,8 +138,13 @@
>> s->buf_end = s->buffer;
>> }
>> s->buf_ptr = s->buffer;
>> - if (s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE)
>> + if (s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE){
>> + if(offset >= s->pos){
>> + skip_buffer(s, offset - s->pos);
>> + return offset;
>> + }
>> return -EPIPE;
>> + }
>
> IMHO you should rather fix avio.c url_seek() instead of doing a url_fseek()
> specific fix
I did so(see the attached patch), but I dont think that is good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flv_http3.patch
Type: text/x-patch
Size: 4210 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060926/2840b2d0/attachment.bin>
More information about the ffmpeg-devel
mailing list