[vlc-devel] [PATCH] use av_close_input_stream and remove AVFMT_NOFILE hack
baptiste.coudurier at gmail.com
Mon Sep 21 02:25:30 CEST 2009
On 09/19/2009 02:22 AM, Rémi Denis-Courmont wrote:
> Le jeudi 17 septembre 2009 02:23:09 Baptiste Coudurier, vous avez écrit :
>> I believe AVFMT_NOFILE code was added to avoid libavformat opening any
>> underlying stream.
> Yes. Except it was not added, it's been there ever since the avformat plugin
>> This should no be necessary when av_open_input_stream
>> and av_close_input_stream are used.
>> This patch therefore change av_close_input_file to av_close_input_stream
>> and remove the AVFMT_NOFILE code.
> How come does the removal of AVFMT_NOFILE fixes a bug when it is supposed to
> make no differences?
> Does it not affect av_find_stream_info() ?
Sorry, my explanation was not clear, it has a side effect in
av_find_stream_info indeed: AVFormatContext->file_size will not be
populated, because no file is present.
This causes AVFormatContext->bit_rate field not to be populated and
therefore disabling mxf seeking feature.
VLC wrapper could populate file_size, though IMHO the good solution is
to not set AVFMT_NO_FILE.
AVFMT_NO_FILE is used for image sequences, null input/output for
example, and file size makes no sense in these situations.
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the vlc-devel