[FFmpeg-devel] [PATCH 2/2] lavd/lavfi: raise info_probe_size if necessary.

Stefano Sabatini stefasab at gmail.com
Fri Jun 1 13:58:24 CEST 2012


On date Monday 2012-04-23 14:02:41 +0200, Nicolas George encoded:
> lavfi outputs rawvideo frames, which can be quite large;
> and due to time-altering filters, the time_base can not
> be used to estimate the frame rate.
> 
> lavfi will raise info_probe_size, to a value probably big enough
> to let lavf probe two frames of each stream.
> 
> It is only done if info_probe_size has its default value,
> and if the new info probe size does not exceeds 8 times
> probesize. With the current value, it is enough for
> three full-HD 24bpp streams.
> 
> The user is still allowed to set a larger value if necessary.
> 
> Fixes trac ticket #1051.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavdevice/lavfi.c |   28 ++++++++++++++++++++++++++++
>  1 files changed, 28 insertions(+), 0 deletions(-)
> 
> diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
> index 0a6eb91..438aaeb 100644
> --- a/libavdevice/lavfi.c
> +++ b/libavdevice/lavfi.c
> @@ -79,6 +79,33 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
>      return 0;
>  }
>  
> +static void raise_info_probe_size(AVFormatContext *avctx)
> +{
> +    unsigned i, size = 0, bps;
> +

> +    if (avctx->info_probe_size) /* not the default value */
> +        return;

I would prefer having this more predictable, so what I suggest is to
add an option, e.g. "auto_info_probe_size" or whatever is consistent
with the libavformat field name, and set it to 1 by default, *and*
warn the user that the device is changing the default value.

This way you can entirely disable the behavior.

[...]
-- 
FFmpeg = Forgiving and Forgiving Mythic Picky Epic Gadget


More information about the ffmpeg-devel mailing list