aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-08 12:43:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-08 12:43:50 +0100
commit6f21fb793238ab6a790b94b86084148d99373ddf (patch)
treedcbedfadb254818965808f3409948fb23ff9fa96 /libavdevice/v4l2.c
parentb0ed88b4c0e9c98881e2db77b697e352fd78e7b4 (diff)
downloadffmpeg-6f21fb793238ab6a790b94b86084148d99373ddf.tar.gz
Revert "v4l2: setting device parameters early"
This reverts commit b1ad9312331759679a9c956233716a67ae681d89. Fixes Ticket #3517 Conflicts: libavdevice/v4l2.c Requested-by: Giorgio Vazzana <mywing81@gmail.com> Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 783a03cfdc..caddf8e7db 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -881,9 +881,6 @@ static int v4l2_read_header(AVFormatContext *ctx)
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
- if ((res = v4l2_set_parameters(ctx)) < 0)
- goto fail;
-
if (s->pixel_format) {
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
@@ -934,6 +931,9 @@ static int v4l2_read_header(AVFormatContext *ctx)
s->pixelformat = desired_format;
+ if ((res = v4l2_set_parameters(ctx)) < 0)
+ goto fail;
+
st->codec->pix_fmt = ff_fmt_v4l2ff(desired_format, codec_id);
s->frame_size =
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);