GESTimeline: Prevent saving timelines without any layers

This commit is contained in:
Edward Hervey 2010-11-27 18:11:56 +01:00
parent 7176c26810
commit 1da6d7a5dd

View file

@ -274,11 +274,16 @@ ges_formatter_save (GESFormatter * formatter, GESTimeline * timeline)
{ {
GESFormatterClass *klass; GESFormatterClass *klass;
/* Saving an empty timeline is not allowed */
g_return_val_if_fail (timeline->layers != NULL, FALSE);
klass = GES_FORMATTER_GET_CLASS (formatter); klass = GES_FORMATTER_GET_CLASS (formatter);
if (klass->save) if (klass->save)
return klass->save (formatter, timeline); return klass->save (formatter, timeline);
GST_ERROR ("not implemented!"); GST_ERROR ("not implemented!");
return FALSE; return FALSE;
} }
@ -370,6 +375,9 @@ ges_formatter_save_to_uri (GESFormatter * formatter, GESTimeline *
{ {
GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (formatter); GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (formatter);
/* Saving an empty timeline is not allowed */
g_return_val_if_fail (timeline->layers != NULL, FALSE);
if (klass->save_to_uri) if (klass->save_to_uri)
return klass->save_to_uri (formatter, timeline, uri); return klass->save_to_uri (formatter, timeline, uri);