[vlc-devel] [PATCH] use av_close_input_stream and remove AVFMT_NOFILE hack
Baptiste Coudurier
baptiste.coudurier at gmail.com
Mon Sep 21 10:41:43 CEST 2009
On 09/21/2009 01:10 AM, Rémi Denis-Courmont wrote:
>
> On Sun, 20 Sep 2009 23:57:48 -0700, Baptiste Coudurier
> <baptiste.coudurier at gmail.com> wrote:
>> I'm not sure to understand what you mean.
>
> I mean, that FFmpeg really must not try to interpret the path.
> And I can only think of two ways for FFmpeg to find the file length:
> - interpret the path and access the file system in VLC's back
> (I think that is a bad idea),
> or
> - have VLC populate the length field
> (you seemed to imply that also was a bad idea).
>
> So now, I assumed that clearing the NOFILE bit would allow FFmpeg to do the
> file system access. Apparently not, but then I don't understand how FFmpeg
> finds the length out, and how the problem was fixed.
Ok I get it.
libavformat calls url_fsize on the underlying IO, which asks to seek at
EOF, and VLC wrapper seeking routing will return "stream_Size(
p_demux->s );" see IOSeek.
That's how libavformat gets the file size and sets
AVFormatContext->file_size.
--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the vlc-devel
mailing list