mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
id3demux: ensure a taglist before adding the container tag
In the case of id3v1 also don't return NULL on empty tags, but also create a new taglist and add the container tag for consistency.
This commit is contained in:
parent
6f6b2a7efc
commit
a86bab6689
1 changed files with 5 additions and 4 deletions
|
@ -183,6 +183,8 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer,
|
||||||
res = id3demux_read_id3v2_tag (buffer, tag_size, tags);
|
res = id3demux_read_id3v2_tag (buffer, tag_size, tags);
|
||||||
|
|
||||||
if (G_LIKELY (res == ID3TAGS_READ_TAG)) {
|
if (G_LIKELY (res == ID3TAGS_READ_TAG)) {
|
||||||
|
if (*tags == NULL)
|
||||||
|
*tags = gst_tag_list_new ();
|
||||||
gst_id3demux_add_container_format (*tags);
|
gst_id3demux_add_container_format (*tags);
|
||||||
return GST_TAG_DEMUX_RESULT_OK;
|
return GST_TAG_DEMUX_RESULT_OK;
|
||||||
} else {
|
} else {
|
||||||
|
@ -191,9 +193,8 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer,
|
||||||
} else {
|
} else {
|
||||||
*tags = gst_tag_list_new_from_id3v1 (GST_BUFFER_DATA (buffer));
|
*tags = gst_tag_list_new_from_id3v1 (GST_BUFFER_DATA (buffer));
|
||||||
|
|
||||||
if (G_UNLIKELY (*tags == NULL))
|
if (*tags == NULL)
|
||||||
return GST_TAG_DEMUX_RESULT_BROKEN_TAG;
|
*tags = gst_tag_list_new ();
|
||||||
|
|
||||||
gst_id3demux_add_container_format (*tags);
|
gst_id3demux_add_container_format (*tags);
|
||||||
*tag_size = ID3V1_TAG_SIZE;
|
*tag_size = ID3V1_TAG_SIZE;
|
||||||
return GST_TAG_DEMUX_RESULT_OK;
|
return GST_TAG_DEMUX_RESULT_OK;
|
||||||
|
|
Loading…
Reference in a new issue