Zebediah Figura : winegstreamer: Return void from wg_parser_stream_seek().

Alexandre Julliard julliard at winehq.org
Tue Oct 5 15:51:40 CDT 2021


Module: wine
Branch: master
Commit: 494039d0d0df8fd5b2b3442caac7bd6c0c7433c0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=494039d0d0df8fd5b2b3442caac7bd6c0c7433c0

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Oct  4 19:20:50 2021 -0500

winegstreamer: Return void from wg_parser_stream_seek().

We do not expect this to fail.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/quartz_parser.c | 12 +++---------
 dlls/winegstreamer/unixlib.h       |  2 +-
 dlls/winegstreamer/wg_parser.c     |  7 ++++---
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index a1fa7daec6f..5dd232ea0da 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -1233,7 +1233,6 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
 {
     struct parser_source *pin = impl_from_IMediaSeeking(iface);
     struct parser *filter = impl_from_strmbase_filter(pin->pin.pin.filter);
-    HRESULT hr = S_OK;
     int i;
 
     TRACE("pin %p, current %s, current_flags %#x, stop %s, stop_flags %#x.\n",
@@ -1270,13 +1269,8 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
 
     SourceSeekingImpl_SetPositions(iface, current, current_flags, stop, stop_flags);
 
-    if (!unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate,
-            pin->seek.llCurrent, pin->seek.llStop, current_flags, stop_flags))
-    {
-        ERR("Failed to seek (current %s, stop %s).\n",
-                debugstr_time(pin->seek.llCurrent), debugstr_time(pin->seek.llStop));
-        hr = E_FAIL;
-    }
+    unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate,
+            pin->seek.llCurrent, pin->seek.llStop, current_flags, stop_flags);
 
     if (!(current_flags & AM_SEEKING_NoFlush))
     {
@@ -1299,7 +1293,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
             LeaveCriticalSection(&pin->flushing_cs);
     }
 
-    return hr;
+    return S_OK;
 }
 
 static const IMediaSeekingVtbl GST_Seeking_Vtbl =
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h
index e917f7b5557..dade020916a 100644
--- a/dlls/winegstreamer/unixlib.h
+++ b/dlls/winegstreamer/unixlib.h
@@ -158,7 +158,7 @@ struct unix_funcs
     /* Returns the duration in 100-nanosecond units. */
     uint64_t (CDECL *wg_parser_stream_get_duration)(struct wg_parser_stream *stream);
     /* start_pos and stop_pos are in 100-nanosecond units. */
-    bool (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate,
+    void (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate,
             uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags);
 };
 
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index b89a50b5d8f..694f8b57ed1 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -686,7 +686,7 @@ static uint64_t CDECL wg_parser_stream_get_duration(struct wg_parser_stream *str
     return stream->duration;
 }
 
-static bool CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
+static void CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
         uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags)
 {
     GstSeekType start_type = GST_SEEK_TYPE_SET, stop_type = GST_SEEK_TYPE_SET;
@@ -704,8 +704,9 @@ static bool CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double
     if ((stop_flags & AM_SEEKING_PositioningBitsMask) == AM_SEEKING_NoPositioning)
         stop_type = GST_SEEK_TYPE_NONE;
 
-    return gst_pad_push_event(stream->my_sink, gst_event_new_seek(rate,
-            GST_FORMAT_TIME, flags, start_type, start_pos * 100, stop_type, stop_pos * 100));
+    if (!gst_pad_push_event(stream->my_sink, gst_event_new_seek(rate, GST_FORMAT_TIME,
+            flags, start_type, start_pos * 100, stop_type, stop_pos * 100)))
+        GST_ERROR("Failed to seek.\n");
 }
 
 static void CDECL wg_parser_stream_notify_qos(struct wg_parser_stream *stream,




More information about the wine-cvs mailing list