winegstreamer: Fix IQualityControl::Notify.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2016-05-19 09:14:48 -05:00 committed by Alexandre Julliard
parent 1def346bab
commit 1517bfb186
1 changed files with 17 additions and 4 deletions

View File

@ -1663,15 +1663,28 @@ static ULONG WINAPI GST_QualityControl_Release(IQualityControl *iface)
static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
{ {
GSTOutPin *pin = impl_from_IQualityControl(iface); GSTOutPin *pin = impl_from_IQualityControl(iface);
REFERENCE_TIME late = qm.Late; GstEvent *evt;
TRACE("(%p)->(%p, { 0x%x %u %s %s })\n", pin, sender, TRACE("(%p)->(%p, { 0x%x %u %s %s })\n", pin, sender,
qm.Type, qm.Proportion, qm.Type, qm.Proportion,
wine_dbgstr_longlong(qm.Late), wine_dbgstr_longlong(qm.Late),
wine_dbgstr_longlong(qm.TimeStamp)); wine_dbgstr_longlong(qm.TimeStamp));
mark_wine_thread(); mark_wine_thread();
if (qm.Late < 0 && -qm.Late > qm.TimeStamp)
late = -qm.TimeStamp; if (qm.Type == Flood)
gst_pad_push_event(pin->my_sink, gst_event_new_qos(late <= 0 ? GST_QOS_TYPE_OVERFLOW : GST_QOS_TYPE_UNDERFLOW, 1000./qm.Proportion, late*100, qm.TimeStamp*100)); qm.Late = 0;
evt = gst_event_new_qos(qm.Type == Famine ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW,
qm.Proportion / 1000., qm.Late * 100, qm.TimeStamp * 100);
if (!evt) {
WARN("Failed to create QOS event\n");
return E_INVALIDARG;
}
gst_pad_push_event(pin->my_sink, evt);
return S_OK; return S_OK;
} }