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.
This commit is contained in:
Sebastian Dröge 2020-01-24 13:04:46 +02:00 committed by Sebastian Dröge
parent 4f51000920
commit 34b1eb117f

View file

@ -1299,8 +1299,8 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
g_value_unset (&item); g_value_unset (&item);
gst_caps_set_value (caps, "stream-format", &arr); gst_caps_set_value (caps, "stream-format", &arr);
g_value_unset (&arr); g_value_unset (&arr);
} else { } else if (context) {
if (context && context->extradata_size > 0) { if (context->extradata_size > 0) {
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "avc", gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "avc",
NULL); NULL);
} else { } else {
@ -1328,8 +1328,8 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
g_value_unset (&item); g_value_unset (&item);
gst_caps_set_value (caps, "stream-format", &arr); gst_caps_set_value (caps, "stream-format", &arr);
g_value_unset (&arr); g_value_unset (&arr);
} else { } else if (context) {
if (context && context->extradata_size > 0) { if (context->extradata_size > 0) {
/* FIXME: Assume hvc1 */ /* FIXME: Assume hvc1 */
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1", gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1",
NULL); NULL);
@ -1472,7 +1472,7 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
NULL); NULL);
gst_codec_utils_aac_caps_set_level_and_profile (caps, gst_codec_utils_aac_caps_set_level_and_profile (caps,
context->extradata, context->extradata_size); context->extradata, context->extradata_size);
} else { } else if (context) {
/* FIXME: Assume adts */ /* FIXME: Assume adts */
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "adts", gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "adts",
NULL); NULL);