qtdemux: handle FLUSH_STOP event

Clean up some state (most notably pad flow returns) to resume
proper streaming following flushing seek.
This commit is contained in:
Mark Nauwelaerts 2009-03-24 15:44:42 +01:00
parent b0c5c7f19b
commit cfb39dbb1b

View file

@ -1229,6 +1229,20 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstEvent * event)
exit: exit:
gst_event_unref (event); gst_event_unref (event);
res = TRUE; res = TRUE;
goto drop;
break;
}
case GST_EVENT_FLUSH_STOP:
{
gint i;
/* clean up, force EOS if no more info follows */
gst_adapter_clear (demux->adapter);
demux->offset = 0;
demux->neededbytes = -1;
/* reset flow return, e.g. following seek */
for (i = 0; i < demux->n_streams; i++)
demux->streams[i]->last_ret = GST_FLOW_OK;
break; break;
} }
case GST_EVENT_EOS: case GST_EVENT_EOS:
@ -1239,12 +1253,14 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstEvent * event)
(_("This file contains no playable streams.")), (_("This file contains no playable streams.")),
("no known streams found")); ("no known streams found"));
} }
/* Fall through */ break;
default: default:
res = gst_pad_event_default (demux->sinkpad, event);
break; break;
} }
res = gst_pad_event_default (demux->sinkpad, event);
drop:
return res; return res;
} }