aboutsummaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorCarl Eugen Hoyos2013-09-01 20:20:47 +0200
committerCarl Eugen Hoyos2013-09-01 21:27:43 +0200
commite337c9d56408dc00a15887309488a1ff5cb06ba3 (patch)
treed1f598b6c84340281f9aa389e926d5e64e878b48 /libavdevice
parent5be7aecc80b5efcd3eb01868caeb01b72b4bfd87 (diff)
Read h264 headers from v4l2 to allow stream-copying.
Fixes ticket #2882. Analyzed and tested by William C Bonner.
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/v4l2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 33668c152f..c7cd5190ff 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -931,6 +931,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)