[PATCH 4/6] winegstreamer: Access the stream duration through a Unix library function.
Zebediah Figura
z.figura12 at gmail.com
Wed Feb 17 17:30:35 CST 2021
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/winegstreamer/gst_private.h | 2 ++
dlls/winegstreamer/gstdemux.c | 2 +-
dlls/winegstreamer/wg_parser.c | 6 ++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 31fca81ce6c..e90de8803e5 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -245,6 +245,8 @@ struct unix_funcs
void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream,
bool underflow, double proportion, int64_t diff, uint64_t timestamp);
+ /* 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,
uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags);
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index ab901a34843..3bea994521b 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -977,7 +977,7 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons
{
struct parser_source *pin = filter->sources[i];
- pin->seek.llDuration = pin->seek.llStop = pin->wg_stream->duration;
+ pin->seek.llDuration = pin->seek.llStop = unix_funcs->wg_parser_stream_get_duration(pin->wg_stream);
pin->seek.llCurrent = 0;
}
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index ccd60853007..5d10ddf753c 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -492,6 +492,11 @@ static void CDECL wg_parser_stream_release_buffer(struct wg_parser_stream *strea
pthread_cond_signal(&stream->event_empty_cond);
}
+static uint64_t CDECL wg_parser_stream_get_duration(struct wg_parser_stream *stream)
+{
+ return stream->duration;
+}
+
static bool 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)
{
@@ -1724,6 +1729,7 @@ static const struct unix_funcs funcs =
wg_parser_stream_release_buffer,
wg_parser_stream_notify_qos,
+ wg_parser_stream_get_duration,
wg_parser_stream_seek,
};
--
2.30.1
More information about the wine-devel
mailing list