winegstreamer: Move up gst_segment_init to prevent a theoretical race condition.
This commit is contained in:
parent
58ff7a48e0
commit
cf085af126
|
@ -396,9 +396,9 @@ static gboolean event_sink(GstPad *pad, GstEvent *event) {
|
||||||
IPin_BeginFlush(pin->pin.pin.pConnectedTo);
|
IPin_BeginFlush(pin->pin.pin.pConnectedTo);
|
||||||
return 1;
|
return 1;
|
||||||
case GST_EVENT_FLUSH_STOP:
|
case GST_EVENT_FLUSH_STOP:
|
||||||
|
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
||||||
if (pin->pin.pin.pConnectedTo)
|
if (pin->pin.pin.pConnectedTo)
|
||||||
IPin_EndFlush(pin->pin.pin.pConnectedTo);
|
IPin_EndFlush(pin->pin.pin.pConnectedTo);
|
||||||
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
|
||||||
return 1;
|
return 1;
|
||||||
default:
|
default:
|
||||||
FIXME("%p stub %s\n", event, gst_event_type_get_name(event->type));
|
FIXME("%p stub %s\n", event, gst_event_type_get_name(event->type));
|
||||||
|
@ -746,12 +746,12 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, gboolean last, GS
|
||||||
pin->isaud = isaud;
|
pin->isaud = isaud;
|
||||||
pin->isvid = isvid;
|
pin->isvid = isvid;
|
||||||
|
|
||||||
|
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
||||||
ret = gst_pad_link(pad, mypad);
|
ret = gst_pad_link(pad, mypad);
|
||||||
gst_pad_activate_push(mypad, 1);
|
gst_pad_activate_push(mypad, 1);
|
||||||
FIXME("Linking: %i\n", ret);
|
FIXME("Linking: %i\n", ret);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
pin->their_src = pad;
|
pin->their_src = pad;
|
||||||
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
|
||||||
gst_object_ref(pin->their_src);
|
gst_object_ref(pin->their_src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -772,9 +772,9 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gboolean last, GSTImp
|
||||||
for (x = 0; x < This->cStreams; ++x) {
|
for (x = 0; x < This->cStreams; ++x) {
|
||||||
GSTOutPin *pin = This->ppPins[x];
|
GSTOutPin *pin = This->ppPins[x];
|
||||||
if (!pin->their_src) {
|
if (!pin->their_src) {
|
||||||
|
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
||||||
if (gst_pad_link(pad, pin->my_sink) >= 0) {
|
if (gst_pad_link(pad, pin->my_sink) >= 0) {
|
||||||
pin->their_src = pad;
|
pin->their_src = pad;
|
||||||
gst_segment_init(pin->segment, GST_FORMAT_TIME);
|
|
||||||
gst_object_ref(pin->their_src);
|
gst_object_ref(pin->their_src);
|
||||||
TRACE("Relinked\n");
|
TRACE("Relinked\n");
|
||||||
LeaveCriticalSection(&This->filter.csFilter);
|
LeaveCriticalSection(&This->filter.csFilter);
|
||||||
|
|
Loading…
Reference in New Issue