Module: wine
Branch: master
Commit: 803274ac14067c4f60363ac8e953db9281dbe46a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=803274ac14067c4f60363ac8…
Author: Jan Sikorski <jsikorski(a)codeweavers.com>
Date: Mon Nov 1 09:07:18 2021 +0100
wined3d: Reduce locking of device context operations.
Only actually take the lock for the immediate context. According to the
d3d11 documentation, operations on device contexts are not thread safe,
and testing on Windows confirms this.
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/wined3d/cs.c | 18 ++---
dlls/wined3d/device.c | 152 ++++++++++++++++++++---------------------
dlls/wined3d/wined3d_private.h | 12 ++++
3 files changed, 97 insertions(+), 85 deletions(-)
Diff: https://source.winehq.org/git/wine.git/?a=commitdiff;h=803274ac14067c4f6036…
Module: wine
Branch: master
Commit: 6f8d366b57e662981c68ba0bd29465f391167de9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6f8d366b57e662981c68ba0b…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Sun Oct 31 19:03:37 2021 -0500
winegstreamer: Seek to the beginning of the range in wm_reader_set_output_props().
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winegstreamer/gst_private.h | 2 ++
dlls/winegstreamer/wm_reader.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index d330716b8f9..109ce6ab28f 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -136,6 +136,8 @@ struct wm_reader
LONG refcount;
CRITICAL_SECTION cs;
+ QWORD start_time;
+
IStream *source_stream;
HANDLE read_thread;
bool read_thread_shutdown;
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 24fd11f652d..82f74318062 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -1543,6 +1543,22 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
stream->format = format;
wg_parser_stream_enable(stream->wg_stream, &format);
+ /* Re-decode any buffers that might have been generated with the old format.
+ *
+ * FIXME: Seeking in-place will cause some buffers to be dropped.
+ * Unfortunately, we can't really store the last received PTS and seek there
+ * either: since seeks are inexact and we aren't guaranteed to receive
+ * samples in order, some buffers might be duplicated or dropped anyway.
+ * In order to really seamlessly allow for format changes, we need
+ * cooperation from each individual GStreamer stream, to be able to tell
+ * upstream exactly which buffers they need resent...
+ *
+ * In all likelihood this function is being called not mid-stream but rather
+ * while setting the stream up, before consuming any events. Accordingly
+ * let's just seek back to the beginning. */
+ wg_parser_stream_seek(reader->streams[0].wg_stream, 1.0, reader->start_time, 0,
+ AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning);
+
LeaveCriticalSection(&reader->cs);
return S_OK;
}
@@ -1643,6 +1659,8 @@ void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration)
EnterCriticalSection(&reader->cs);
+ reader->start_time = start;
+
wg_parser_stream_seek(reader->streams[0].wg_stream, 1.0, start, start + duration,
AM_SEEKING_AbsolutePositioning, duration ? AM_SEEKING_AbsolutePositioning : AM_SEEKING_NoPositioning);