summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-28 20:24:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-28 20:28:59 +0100
commitb56e029bdc9a68ed9decc7d3ad77e15aa5f4071d (patch)
tree021329b468e566bd874cc66c8d613a26aa3259da /libavdevice
parent33240dfa9acad976ed60dbddaf08e441d029b53b (diff)
downloadffmpeg-b56e029bdc9a68ed9decc7d3ad77e15aa5f4071d.tar.gz
avformat/lavfi: force probesize to cover at least 30 frames
This ensures that fps and other values are estimated correctly, the probesize also is intended to limit disk/protocol reads which does not apply to lavfi inputs at all. Fixes Ticket1051 Something similar could be usefull to other input devices Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/lavfi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index e4cacb640e..3b6f0c382c 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -282,6 +282,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
st->codec->height = link->h;
st ->sample_aspect_ratio =
st->codec->sample_aspect_ratio = link->sample_aspect_ratio;
+ avctx->probesize = FFMAX(avctx->probesize,
+ link->w * link->h *
+ av_get_padded_bits_per_pixel(av_pix_fmt_desc_get(link->format)) *
+ 30);
} else if (link->type == AVMEDIA_TYPE_AUDIO) {
st->codec->codec_id = av_get_pcm_codec(link->format, -1);
st->codec->channels = av_get_channel_layout_nb_channels(link->channel_layout);