diff options
author | Stefan Kost <ensonic@users.sf.net> | 2011-02-08 10:07:43 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2011-02-08 10:07:43 +0200 |
commit | a86bab66893bb1a3323a756410573c117b8219ef (patch) | |
tree | 355249ed2dfead3843892459c9331f47cd8a107f | |
parent | 6f6b2a7efce1f1368344eab4b4625c0fc30000ad (diff) |
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.
-rw-r--r-- | gst/id3demux/gstid3demux.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index 93685041a..e91524211 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -25,7 +25,7 @@ * id3demux accepts data streams with either (or both) ID3v2 regions at the * start, or ID3v1 at the end. The mime type of the data between the tag blocks * is detected using typefind functions, and the appropriate output mime type - * set on outgoing buffers. + * set on outgoing buffers. * * The element is only able to read ID3v1 tags from a seekable stream, because * they are at the end of the stream. That is, when get_range mode is supported @@ -183,6 +183,8 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer, res = id3demux_read_id3v2_tag (buffer, tag_size, tags); if (G_LIKELY (res == ID3TAGS_READ_TAG)) { + if (*tags == NULL) + *tags = gst_tag_list_new (); gst_id3demux_add_container_format (*tags); return GST_TAG_DEMUX_RESULT_OK; } else { @@ -191,9 +193,8 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer, } else { *tags = gst_tag_list_new_from_id3v1 (GST_BUFFER_DATA (buffer)); - if (G_UNLIKELY (*tags == NULL)) - return GST_TAG_DEMUX_RESULT_BROKEN_TAG; - + if (*tags == NULL) + *tags = gst_tag_list_new (); gst_id3demux_add_container_format (*tags); *tag_size = ID3V1_TAG_SIZE; return GST_TAG_DEMUX_RESULT_OK; |