aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-09-01 20:20:47 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-09-05 22:49:52 +0200
commitfc4c29bc6efddc93a1a86c84ebdd49373478a139 (patch)
tree153616922e95256ce813212589baf4343da86ff4
parent6158eec53f98c04e4194ff5a46566259ed9e66f4 (diff)
downloadffmpeg-fc4c29bc6efddc93a1a86c84ebdd49373478a139.tar.gz
Read h264 headers from v4l2 to allow stream-copying.
Fixes ticket #2882. Analyzed and tested by William C Bonner. (cherry picked from commit e337c9d56408dc00a15887309488a1ff5cb06ba3)
-rw-r--r--libavdevice/v4l2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 1f43f0727f..b1dc7d10a0 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -929,6 +929,9 @@ static int v4l2_read_header(AVFormatContext *s1)
if (codec_id == AV_CODEC_ID_RAWVIDEO)
st->codec->codec_tag =
avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
+ else if (codec_id == AV_CODEC_ID_H264) {
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ }
if (desired_format == V4L2_PIX_FMT_YVU420)
st->codec->codec_tag = MKTAG('Y', 'V', '1', '2');
else if (desired_format == V4L2_PIX_FMT_YVU410)