diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-11-04 00:12:22 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-04 00:14:13 +0200 |
commit | 85984fa94689c318590a55fc83eac834463b21b0 (patch) | |
tree | 508dace47bbcfa12a355b6f058c33cacfe1f2189 | |
parent | 4ca84a9b1a0ee1643a698662680aab4cd0d46ef0 (diff) | |
download | gstreamer-plugins-base-85984fa94689c318590a55fc83eac834463b21b0.tar.gz |
opusenc: Create an empty taglist if there is none
There always have to be 2 buffers in the streamheaders, even if
the comment buffer is basically empty.
-rw-r--r-- | ext/opus/gstopusenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 4196c1c8c..729b2150c 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -711,6 +711,7 @@ gst_opus_enc_setup (GstOpusEnc * enc) gboolean ret; gint32 lookahead; const GstTagList *tags; + GstTagList *empty_tags = NULL; GstBuffer *header, *comments; #ifndef GST_DISABLE_GST_DEBUG @@ -763,10 +764,14 @@ gst_opus_enc_setup (GstOpusEnc * enc) enc->n_channels - enc->n_stereo_streams, enc->n_stereo_streams, enc->decoding_channel_mapping, lookahead, 0); tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (enc)); + if (!tags) + tags = empty_tags = gst_tag_list_new_empty (); comments = gst_tag_list_to_vorbiscomment_buffer (tags, (const guint8 *) "OpusTags", 8, "Encoded with GStreamer opusenc"); caps = gst_codec_utils_opus_create_caps_from_header (header, comments); + if (empty_tags) + gst_tag_list_unref (empty_tags); gst_buffer_unref (header); gst_buffer_unref (comments); |