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
This commit is contained in:
Anton Belka 2012-08-09 19:41:34 +03:00 committed by Sebastian Dröge
parent 90740c3fee
commit 59186f970d

View file

@ -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);