wok-6.x view gst-plugins-ugly/stuff/libcdio.u @ rev 21577
qbittorrent: try gcc83
author | Hans-G?nter Theisgen |
---|---|
date | Sun May 19 15:28:18 2019 +0100 (2019-05-19) |
parents | |
children |
line source
1 --- ext/cdio/gstcdio.h
2 +++ ext/cdio/gstcdio.h
3 @@ -28,11 +28,20 @@
4 GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug);
5 #define GST_CAT_DEFAULT gst_cdio_debug
7 +#if LIBCDIO_VERSION_NUM >= 90
8 void gst_cdio_add_cdtext_field (GstObject * src,
9 cdtext_t * cdtext,
10 cdtext_field_t field,
11 const gchar * gst_tag,
12 + GstTagList ** p_tags,
13 + track_t track);
14 +#else
15 +void gst_cdio_add_cdtext_field (GstObject * src,
16 + cdtext_t * cdtext,
17 + cdtext_field_t field,
18 + const gchar * gst_tag,
19 GstTagList ** p_tags);
20 +#endif
22 GstTagList * gst_cdio_get_cdtext (GstObject * src,
23 CdIo * cdio,
24 --- ext/cdio/gstcdio.c
25 +++ ext/cdio/gstcdio.c
26 @@ -30,12 +30,21 @@
27 GST_DEBUG_CATEGORY (gst_cdio_debug);
29 void
30 +#if LIBCDIO_VERSION_NUM >= 90
31 gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext,
32 + cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags, track_t track)
33 +#else
34 +gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext,
35 cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags)
36 +#endif
37 {
38 const gchar *txt;
40 +#if LIBCDIO_VERSION_NUM >= 90
41 + txt = cdtext_get_const (cdtext, field, track);
42 +#else
43 txt = cdtext_get_const (field, cdtext);
44 +#endif
45 if (txt == NULL || *txt == '\0') {
46 GST_DEBUG_OBJECT (src, "empty CD-TEXT field %u (%s)", field, gst_tag);
47 return;
48 @@ -62,14 +71,23 @@
49 GstTagList *tags = NULL;
50 cdtext_t *t;
52 +#if LIBCDIO_VERSION_NUM >= 90
53 + t = cdio_get_cdtext (cdio);
54 +#else
55 t = cdio_get_cdtext (cdio, track);
56 +#endif
57 if (t == NULL) {
58 GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", track);
59 return NULL;
60 }
62 +#if LIBCDIO_VERSION_NUM >= 90
63 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_PERFORMER, GST_TAG_ARTIST, &tags, track);
64 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_TITLE, GST_TAG_TITLE, &tags, track);
65 +#else
66 gst_cdio_add_cdtext_field (src, t, CDTEXT_PERFORMER, GST_TAG_ARTIST, &tags);
67 gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_TITLE, &tags);
68 +#endif
70 return tags;
71 }
72 @@ -79,15 +97,24 @@
73 {
74 cdtext_t *t;
76 +#if LIBCDIO_VERSION_NUM >= 90
77 + t = cdio_get_cdtext (cdio);
78 +#else
79 t = cdio_get_cdtext (cdio, 0);
80 +#endif
81 if (t == NULL) {
82 GST_DEBUG_OBJECT (src, "no CD-TEXT for album");
83 return;
84 }
86 /* FIXME: map CDTEXT_PERFORMER to GST_TAG_ALBUM_ARTIST once we have that */
87 +#if LIBCDIO_VERSION_NUM >= 90
88 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_TITLE, GST_TAG_ALBUM, &tags, 0);
89 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_GENRE, GST_TAG_GENRE, &tags, 0);
90 +#else
91 gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_ALBUM, &tags);
92 gst_cdio_add_cdtext_field (src, t, CDTEXT_GENRE, GST_TAG_GENRE, &tags);
93 +#endif
95 GST_DEBUG ("CD-TEXT album tags: %" GST_PTR_FORMAT, tags);
96 }