+ case GST_MESSAGE_EOS: /* End of stream */
+ /* Decrease repeats if not set to forever */
+ if(s->repeats != (glui32)-1)
+ s->repeats--;
+ if(s->repeats > 0) {
+ if(!gst_element_seek_simple(s->pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, 0)) {
+ WARNING(_("Could not execute GStreamer seek"));
+ clean_up_after_playing_sound(s);
+ }
+ } else {
+ clean_up_after_playing_sound(s);
+ /* Sound ended normally, send a notification if requested */
+ if(s->notify)
+ event_throw(s->glk, evtype_SoundNotify, NULL, s->resource, s->notify);
+ }