winegstreamer: Access the stream duration through a Unix library function.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9a6aa56cd8
commit
82d4fa9f96
|
@ -245,6 +245,8 @@ struct unix_funcs
|
||||||
void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream,
|
void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream,
|
||||||
bool underflow, double proportion, int64_t diff, uint64_t timestamp);
|
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. */
|
/* start_pos and stop_pos are in 100-nanosecond units. */
|
||||||
bool (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate,
|
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);
|
uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags);
|
||||||
|
|
|
@ -977,7 +977,7 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons
|
||||||
{
|
{
|
||||||
struct parser_source *pin = filter->sources[i];
|
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;
|
pin->seek.llCurrent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,11 @@ static void CDECL wg_parser_stream_release_buffer(struct wg_parser_stream *strea
|
||||||
pthread_cond_signal(&stream->event_empty_cond);
|
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,
|
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)
|
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_release_buffer,
|
||||||
wg_parser_stream_notify_qos,
|
wg_parser_stream_notify_qos,
|
||||||
|
|
||||||
|
wg_parser_stream_get_duration,
|
||||||
wg_parser_stream_seek,
|
wg_parser_stream_seek,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue