1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

winegstreamer: Use IWMSyncReader2_SetRange in the async reader.

This commit is contained in:
Rémi Bernon 2022-09-09 01:09:36 +02:00 committed by Alexandre Julliard
parent b8aa25fe4e
commit 96acd9dc32
3 changed files with 14 additions and 22 deletions

View File

@ -199,7 +199,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number);
HRESULT wm_reader_get_stream_selection(struct wm_reader *reader,
WORD stream_number, WMT_STREAM_SELECTION *selection);
void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration);
HRESULT wm_reader_set_allocate_for_output(struct wm_reader *reader, DWORD output, BOOL allocate);
HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate);
HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,

View File

@ -244,10 +244,9 @@ static DWORD WINAPI async_reader_callback_thread(void *arg)
{
reader->context = op->u.start.context;
if (SUCCEEDED(hr))
{
wm_reader_seek(reader->wm_reader, op->u.start.start, op->u.start.duration);
hr = IWMSyncReader2_SetRange(reader->reader, op->u.start.start, op->u.start.duration);
if (SUCCEEDED(hr))
reader->clock_start = get_current_time(reader);
}
LeaveCriticalSection(&reader->callback_cs);
IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr,

View File

@ -1886,23 +1886,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
}
}
void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration)
{
WORD i;
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);
for (i = 0; i < reader->stream_count; ++i)
reader->streams[i].eos = false;
LeaveCriticalSection(&reader->cs);
}
HRESULT wm_reader_set_streams_selected(struct wm_reader *reader, WORD count,
const WORD *stream_numbers, const WMT_STREAM_SELECTION *selections)
{
@ -2415,10 +2398,21 @@ static HRESULT WINAPI reader_SetOutputSetting(IWMSyncReader2 *iface, DWORD outpu
static HRESULT WINAPI reader_SetRange(IWMSyncReader2 *iface, QWORD start, LONGLONG duration)
{
struct wm_reader *reader = impl_from_IWMSyncReader2(iface);
WORD i;
TRACE("reader %p, start %I64u, duration %I64d.\n", reader, start, duration);
wm_reader_seek(reader, start, 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);
for (i = 0; i < reader->stream_count; ++i)
reader->streams[i].eos = false;
LeaveCriticalSection(&reader->cs);
return S_OK;
}