diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-03-21 16:05:41 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-03-21 16:06:46 +0100 |
commit | 15f07e7f127e5750a908af830d75d0aa26a4a371 (patch) | |
tree | e91ff0029258e0269db45a0059e58521cf76ad41 | |
parent | adae7f18594179b9109e9c353885eb07061d1a66 (diff) |
midiparse: small cleanups in error paths
-rw-r--r-- | gst/midi/midiparse.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gst/midi/midiparse.c b/gst/midi/midiparse.c index 8a39984fd..fd9c17a2c 100644 --- a/gst/midi/midiparse.c +++ b/gst/midi/midiparse.c @@ -880,7 +880,7 @@ handle_play_midi (GstMidiParse * midiparse, static GstFlowReturn gst_midi_parse_do_play (GstMidiParse * midiparse) { - GstFlowReturn res = GST_FLOW_OK; + GstFlowReturn res; GList *walk; guint64 pulse, next_pulse = G_MAXUINT64; GstClockTime position, next_position; @@ -899,7 +899,7 @@ gst_midi_parse_do_play (GstMidiParse * midiparse) while (!track->eot && track->pulse == pulse) { res = handle_next_event (midiparse, track, &cb, NULL); if (res != GST_FLOW_OK) - goto done; + goto error; } if (!track->eot && track->pulse < next_pulse) @@ -919,8 +919,6 @@ gst_midi_parse_do_play (GstMidiParse * midiparse) /* send 10ms ticks to advance the downstream element */ while (TRUE) { - guint8 midi_tick = 0xf9; - /* get position of next tick */ position = ++tick * (10 * GST_MSECOND); GST_DEBUG_OBJECT (midiparse, "tick %" G_GUINT64_FORMAT @@ -930,20 +928,28 @@ gst_midi_parse_do_play (GstMidiParse * midiparse) break; midiparse->segment.position = position; - handle_play_midi (midiparse, midi_tick, NULL, 0, NULL); + res = handle_play_midi (midiparse, 0xf9, NULL, 0, NULL); + if (res != GST_FLOW_OK) + goto error; } midiparse->pulse = next_pulse; midiparse->segment.position = next_position; -done: - return res; + return GST_FLOW_OK; + /* ERRORS */ eos: { GST_DEBUG_OBJECT (midiparse, "we are EOS"); return GST_FLOW_EOS; } +error: + { + GST_DEBUG_OBJECT (midiparse, "have flow result %s", + gst_flow_get_name (res)); + return res; + } } static gboolean |