[Ffmpeg-devel] [PATCH] flv with streamed ByteIO support
Michael Niedermayer
michaelni
Tue Sep 26 14:46:16 CEST 2006
Hi
On Tue, Sep 26, 2006 at 08:51:56PM +0900, nazo wrote:
> Sorry,I made a mistake. actual patch is attached.
> 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
[...]
> @@ -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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list