diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-01-24 13:04:46 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2020-01-24 11:05:53 +0000 |
commit | 34b1eb117faa5cc2f13fe1782abd541f4594645c (patch) | |
tree | 23d37874e2d1c68b45b7c2251696f9fd02cc937f | |
parent | 4f51000920910abf549e1b6b6f0600a3bc069b66 (diff) |
avdemux: Only set stream-format for H264/H265/AAC when we have a context
Otherwise we don't know yet whether we'll have extradata/codec_data, so
can't decide on the stream-format yet.
-rw-r--r-- | ext/libav/gstavcodecmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index cb18f64..442d333 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -1299,8 +1299,8 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, g_value_unset (&item); gst_caps_set_value (caps, "stream-format", &arr); g_value_unset (&arr); - } else { - if (context && context->extradata_size > 0) { + } else if (context) { + if (context->extradata_size > 0) { gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "avc", NULL); } else { @@ -1328,8 +1328,8 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, g_value_unset (&item); gst_caps_set_value (caps, "stream-format", &arr); g_value_unset (&arr); - } else { - if (context && context->extradata_size > 0) { + } else if (context) { + if (context->extradata_size > 0) { /* FIXME: Assume hvc1 */ gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1", NULL); @@ -1472,7 +1472,7 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, NULL); gst_codec_utils_aac_caps_set_level_and_profile (caps, context->extradata, context->extradata_size); - } else { + } else if (context) { /* FIXME: Assume adts */ gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "adts", NULL); |