Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e9548e80e4b..7429b360b3a 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1972,6 +1972,7 @@ static ULONG WINAPI GST_QualityControl_Release(IQualityControl *iface) static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) { struct gstdemux_source *pin = impl_from_IQualityControl(iface); + GstQOSType type = GST_QOS_TYPE_OVERFLOW; GstEvent *evt;
TRACE("(%p)->(%p, { 0x%x %u %s %s })\n", pin, sender, @@ -1984,8 +1985,13 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil if (qm.Type == Flood) 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); + /* GSTQOS_TYPE_OVERFLOW is also used for buffers that arrive on time, but + * DirectShow filters might use Famine, so check that there actually is an + * underrun. */ + if (qm.Type == Famine && qm.Proportion > 1000) + type = GST_QOS_TYPE_UNDERFLOW; + + evt = gst_event_new_qos(type, qm.Proportion / 1000.0, qm.Late * 100, qm.TimeStamp * 100);
if (!evt) { WARN("Failed to create QOS event\n");
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48593 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 7429b360b3a..6897eeda3f1 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1973,6 +1973,8 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil { struct gstdemux_source *pin = impl_from_IQualityControl(iface); GstQOSType type = GST_QOS_TYPE_OVERFLOW; + GstClockTime timestamp; + GstClockTimeDiff diff; GstEvent *evt;
TRACE("(%p)->(%p, { 0x%x %u %s %s })\n", pin, sender, @@ -1982,16 +1984,23 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil
mark_wine_thread();
- if (qm.Type == Flood) - qm.Late = 0; - /* GSTQOS_TYPE_OVERFLOW is also used for buffers that arrive on time, but * DirectShow filters might use Famine, so check that there actually is an * underrun. */ if (qm.Type == Famine && qm.Proportion > 1000) type = GST_QOS_TYPE_UNDERFLOW;
- evt = gst_event_new_qos(type, qm.Proportion / 1000.0, qm.Late * 100, qm.TimeStamp * 100); + /* DirectShow filters sometimes pass negative timestamps (Audiosurf uses the + * current time instead of the time of the last buffer). GstClockTime is + * unsigned, so clamp it to 0. */ + timestamp = max(qm.TimeStamp * 100, 0); + + /* The documentation specifies that timestamp + diff must be nonnegative. */ + diff = qm.Late * 100; + if (timestamp < -diff) + diff = -timestamp; + + evt = gst_event_new_qos(type, qm.Proportion / 1000.0, diff, timestamp);
if (!evt) { WARN("Failed to create QOS event\n");
If the stride is not equal to the width, this calculation will be invalid.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- This fixes Dark Souls II: Scholar of the First Sin, which has an 854x480 video which we transcode to RGB24.
dlls/winegstreamer/gstdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 6897eeda3f1..7595c8ec54e 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -247,7 +247,7 @@ static gboolean amt_from_gst_caps_video_raw(const GstCaps *caps, AM_MEDIA_TYPE * } bih->biCompression = amt->subtype.Data1; } - bih->biSizeImage = width * height * bih->biBitCount / 8; + bih->biSizeImage = vinfo.size; if ((vih->AvgTimePerFrame = (REFERENCE_TIME)MulDiv(10000000, denom, nom)) == -1) vih->AvgTimePerFrame = 0; /* zero division or integer overflow */ bih->biSize = sizeof(*bih);
On Fri, Mar 13, 2020 at 04:02:45PM -0500, Zebediah Figura wrote:
If the stride is not equal to the width, this calculation will be invalid.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
This fixes Dark Souls II: Scholar of the First Sin, which has an 854x480 video which we transcode to RGB24.
dlls/winegstreamer/gstdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 6897eeda3f1..7595c8ec54e 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -247,7 +247,7 @@ static gboolean amt_from_gst_caps_video_raw(const GstCaps *caps, AM_MEDIA_TYPE * } bih->biCompression = amt->subtype.Data1; }
- bih->biSizeImage = width * height * bih->biBitCount / 8;
- bih->biSizeImage = vinfo.size;
I think this won't actually fix the game. I'm pretty sure the calculation we use to determine the buffer size is the one in amt_from_gst_caps.
(Also note the game's video does play back fine. It was my substitution of a different OGG video with that resolution that broke it.)
Andrew
On 3/16/20 6:35 AM, Andrew Eikum wrote:
On Fri, Mar 13, 2020 at 04:02:45PM -0500, Zebediah Figura wrote:
If the stride is not equal to the width, this calculation will be invalid.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
This fixes Dark Souls II: Scholar of the First Sin, which has an 854x480 video which we transcode to RGB24.
dlls/winegstreamer/gstdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 6897eeda3f1..7595c8ec54e 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -247,7 +247,7 @@ static gboolean amt_from_gst_caps_video_raw(const GstCaps *caps, AM_MEDIA_TYPE * } bih->biCompression = amt->subtype.Data1; }
- bih->biSizeImage = width * height * bih->biBitCount / 8;
- bih->biSizeImage = vinfo.size;
I think this won't actually fix the game. I'm pretty sure the calculation we use to determine the buffer size is the one in amt_from_gst_caps.
Thanks, good point. I've sent a new patch that should fix that. The first two patches in this series should apply independent of that.
(Also note the game's video does play back fine. It was my substitution of a different OGG video with that resolution that broke it.)
Andrew