How to extract only a certain tag from the stream?

Edward Hervey edward.hervey at collabora.co.uk
Sat Jun 11 22:57:11 PDT 2011


On Sat, 2011-06-11 at 18:12 -0400, Phong Cao wrote:

> 
>     if (tag == (gchar*) "artist") {

  And what if the pointer contained in tag isn't the same as the local
pointer for (gchar*) "artist" ? This is basic pointer 

  And that check is useless anyway, you can directly do ...

    if (gst_tag_list_get_string_index(list, GST_TAG_ARTIST, 0, &str)) {
      g_print("%s : %20s\n", GST_TAG_ARTIST, str);
      /* Do something with str */
      g_free (str);
    }

    ... without the need to call gst_tag_list_foreach(). If there's no
GST_TAG_ARTIST in that list it will return FALSE, and if there's one it
will return the first occurence.

     Edward

> 
> 
> 
> 
> Best regards,
> 
> 
> Phong Cao
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
Edward Hervey  --  Collabora Multimedia
Project Manager              Co-Founder



More information about the gstreamer-devel mailing list