summaryrefslogtreecommitdiff
path: root/ext/flac/gstflacenc.c
diff options
context:
space:
mode:
authorAnton Belka <antonbelka@gmail.com>2012-08-09 19:41:34 +0300
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-08-10 14:24:28 +0200
commit59186f970d322d3094796ca5d337f3a129e4d23f (patch)
tree0dd7a3fa244d709b3272a686f283167ad9d03f83 /ext/flac/gstflacenc.c
parent90740c3fee9ba089ef141de8c78dedde4078c2fd (diff)
flacenc: allow a TOC with single alternative top-level entry
Allow a TOC that has a single alternative top-level entry with multiple sequence sub-entries https://bugzilla.gnome.org/show_bug.cgi?id=540891
Diffstat (limited to 'ext/flac/gstflacenc.c')
-rw-r--r--ext/flac/gstflacenc.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c
index a7cb21915..12b5a8b3d 100644
--- a/ext/flac/gstflacenc.c
+++ b/ext/flac/gstflacenc.c
@@ -501,7 +501,7 @@ add_cuesheet (const GstToc * toc, guint sample_rate,
const gchar *is_legal;
GList *list;
GstTagList *tags;
- GstTocEntry *entry;
+ GstTocEntry *entry, *subentry = NULL;
FLAC__StreamMetadata_CueSheet *cs;
FLAC__StreamMetadata_CueSheet_Track *track;
@@ -511,15 +511,28 @@ add_cuesheet (const GstToc * toc, guint sample_rate,
/* check if the TOC entries is valid */
list = gst_toc_get_entries (toc);
- while (list) {
- entry = list->data;
- if (!gst_toc_entry_is_sequence (entry))
- return FALSE;
- list = g_list_next (list);
+ entry = list->data;
+ if (gst_toc_entry_is_alternative (entry)) {
+ list = gst_toc_entry_get_sub_entries (entry);
+ while (list) {
+ subentry = list->data;
+ if (!gst_toc_entry_is_sequence (subentry))
+ return FALSE;
+ list = g_list_next (list);
+ }
+ list = gst_toc_entry_get_sub_entries (entry);
+ }
+ if (gst_toc_entry_is_sequence (entry)) {
+ while (list) {
+ entry = list->data;
+ if (!gst_toc_entry_is_sequence (entry))
+ return FALSE;
+ list = g_list_next (list);
+ }
+ list = gst_toc_get_entries (toc);
}
/* add tracks in cuesheet */
- list = gst_toc_get_entries (toc);
while (list) {
entry = list->data;
gst_toc_entry_get_start_stop_times (entry, &start, &stop);