Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
488c9c66
Commit
488c9c66
authored
Jul 06, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move IWMReaderCallbackAdvanced *callback_advanced to a local variable.
parent
4a433122
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
22 deletions
+18
-22
gst_private.h
dlls/winegstreamer/gst_private.h
+1
-3
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+15
-12
wm_reader.c
dlls/winegstreamer/wm_reader.c
+1
-6
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+1
-1
No files found.
dlls/winegstreamer/gst_private.h
View file @
488c9c66
...
...
@@ -181,8 +181,6 @@ struct wm_reader
struct
wm_stream
*
streams
;
WORD
stream_count
;
IWMReaderCallbackAdvanced
*
callback_advanced
;
const
struct
wm_reader_ops
*
ops
;
};
...
...
@@ -202,7 +200,7 @@ HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output,
IWMOutputMediaProps
**
props
);
struct
wm_stream
*
wm_reader_get_stream_by_stream_number
(
struct
wm_reader
*
reader
,
WORD
stream_number
);
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
IWMReaderCallbackAdvanced
*
callback_advanced
,
WORD
stream_number
,
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
);
...
...
dlls/winegstreamer/wm_asyncreader.c
View file @
488c9c66
...
...
@@ -57,22 +57,17 @@ static REFERENCE_TIME get_current_time(const struct async_reader *reader)
static
void
open_stream
(
struct
async_reader
*
reader
,
IWMReaderCallback
*
callback
,
void
*
context
)
{
static
const
DWORD
zero
;
HRESULT
hr
;
IWMReaderCallback_AddRef
(
reader
->
callback
=
callback
);
reader
->
context
=
context
;
IWMReaderCallback_OnStatus
(
callback
,
WMT_OPENED
,
S_OK
,
WMT_TYPE_DWORD
,
(
BYTE
*
)
&
zero
,
context
);
if
(
FAILED
(
hr
=
IWMReaderCallback_QueryInterface
(
callback
,
&
IID_IWMReaderCallbackAdvanced
,
(
void
**
)
&
reader
->
reader
.
callback_advanced
)))
reader
->
reader
.
callback_advanced
=
NULL
;
TRACE
(
"Querying for IWMReaderCallbackAdvanced returned %#lx.
\n
"
,
hr
);
}
static
DWORD
WINAPI
stream_thread
(
void
*
arg
)
{
struct
async_reader
*
reader
=
arg
;
IWMReaderCallback
*
callback
=
reader
->
callback
;
IWMReaderCallbackAdvanced
*
callback_advanced
;
REFERENCE_TIME
start_time
;
struct
wm_stream
*
stream
;
static
const
DWORD
zero
;
...
...
@@ -86,9 +81,14 @@ static DWORD WINAPI stream_thread(void *arg)
EnterCriticalSection
(
&
reader
->
stream_cs
);
if
(
FAILED
(
hr
=
IWMReaderCallback_QueryInterface
(
callback
,
&
IID_IWMReaderCallbackAdvanced
,
(
void
**
)
&
callback_advanced
)))
callback_advanced
=
NULL
;
TRACE
(
"Querying for IWMReaderCallbackAdvanced returned %#lx.
\n
"
,
hr
);
while
(
reader
->
running
)
{
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
,
0
,
&
sample
,
&
pts
,
&
duration
,
&
flags
,
&
stream_number
);
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
,
callback_advanced
,
0
,
&
sample
,
&
pts
,
&
duration
,
&
flags
,
&
stream_number
);
if
(
hr
!=
S_OK
)
break
;
...
...
@@ -98,10 +98,10 @@ static DWORD WINAPI stream_thread(void *arg)
{
QWORD
user_time
=
reader
->
user_time
;
if
(
pts
>
user_time
&&
reader
->
reader
.
callback_advanced
)
if
(
pts
>
user_time
&&
callback_advanced
)
{
LeaveCriticalSection
(
&
reader
->
stream_cs
);
IWMReaderCallbackAdvanced_OnTime
(
reader
->
reader
.
callback_advanced
,
user_time
,
reader
->
context
);
IWMReaderCallbackAdvanced_OnTime
(
callback_advanced
,
user_time
,
reader
->
context
);
EnterCriticalSection
(
&
reader
->
stream_cs
);
}
...
...
@@ -126,7 +126,7 @@ static DWORD WINAPI stream_thread(void *arg)
{
LeaveCriticalSection
(
&
reader
->
stream_cs
);
if
(
stream
->
read_compressed
)
hr
=
IWMReaderCallbackAdvanced_OnStreamSample
(
reader
->
reader
.
callback_advanced
,
hr
=
IWMReaderCallbackAdvanced_OnStreamSample
(
callback_advanced
,
stream_number
,
pts
,
duration
,
flags
,
sample
,
reader
->
context
);
else
hr
=
IWMReaderCallback_OnSample
(
callback
,
stream_number
-
1
,
pts
,
duration
,
...
...
@@ -148,12 +148,12 @@ static DWORD WINAPI stream_thread(void *arg)
IWMReaderCallback_OnStatus
(
callback
,
WMT_EOF
,
S_OK
,
WMT_TYPE_DWORD
,
(
BYTE
*
)
&
zero
,
reader
->
context
);
if
(
reader
->
user_clock
&&
reader
->
reader
.
callback_advanced
)
if
(
reader
->
user_clock
&&
callback_advanced
)
{
/* We can only get here if user_time is greater than the PTS
* of all samples, in which case we cannot have sent this
* notification already. */
IWMReaderCallbackAdvanced_OnTime
(
reader
->
reader
.
callback_advanced
,
IWMReaderCallbackAdvanced_OnTime
(
callback_advanced
,
reader
->
user_time
,
reader
->
context
);
}
...
...
@@ -164,6 +164,9 @@ static DWORD WINAPI stream_thread(void *arg)
ERR
(
"Failed to get sample, hr %#lx.
\n
"
,
hr
);
}
if
(
callback_advanced
)
IWMReaderCallbackAdvanced_Release
(
callback_advanced
);
TRACE
(
"Reader is stopping; exiting.
\n
"
);
return
0
;
}
...
...
dlls/winegstreamer/wm_reader.c
View file @
488c9c66
...
...
@@ -1607,10 +1607,6 @@ HRESULT wm_reader_close(struct wm_reader *reader)
CloseHandle
(
reader
->
read_thread
);
reader
->
read_thread
=
NULL
;
if
(
reader
->
callback_advanced
)
IWMReaderCallbackAdvanced_Release
(
reader
->
callback_advanced
);
reader
->
callback_advanced
=
NULL
;
wg_parser_destroy
(
reader
->
wg_parser
);
reader
->
wg_parser
=
NULL
;
...
...
@@ -1871,10 +1867,9 @@ static WORD get_earliest_buffer(struct wm_reader *reader, struct wg_parser_buffe
return
stream_number
;
}
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
IWMReaderCallbackAdvanced
*
callback_advanced
,
WORD
stream_number
,
INSSBuffer
**
ret_sample
,
QWORD
*
pts
,
QWORD
*
duration
,
DWORD
*
flags
,
WORD
*
ret_stream_number
)
{
IWMReaderCallbackAdvanced
*
callback_advanced
=
reader
->
callback_advanced
;
struct
wg_parser_stream
*
wg_stream
;
struct
wg_parser_buffer
wg_buffer
;
struct
wm_stream
*
stream
;
...
...
dlls/winegstreamer/wm_syncreader.c
View file @
488c9c66
...
...
@@ -92,7 +92,7 @@ static HRESULT WINAPI WMSyncReader_GetNextSample(IWMSyncReader2 *iface,
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
,
stream_number
,
sample
,
pts
,
duration
,
flags
,
&
stream_number
);
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
,
NULL
,
stream_number
,
sample
,
pts
,
duration
,
flags
,
&
stream_number
);
if
(
output_number
&&
hr
==
S_OK
)
*
output_number
=
stream_number
-
1
;
if
(
ret_stream_number
&&
(
hr
==
S_OK
||
stream_number
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment