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
1cc29f96
Commit
1cc29f96
authored
Nov 23, 2023
by
Alfred Agrell
Committed by
Alexandre Julliard
Dec 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move file size to struct wm_reader.
parent
7dbc8d59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
20 deletions
+9
-20
wm_reader.c
dlls/winegstreamer/wm_reader.c
+9
-20
No files found.
dlls/winegstreamer/wm_reader.c
View file @
1cc29f96
...
...
@@ -55,6 +55,7 @@ struct wm_reader
CRITICAL_SECTION
cs
;
QWORD
start_time
;
QWORD
file_size
;
IStream
*
source_stream
;
HANDLE
file
;
...
...
@@ -592,27 +593,12 @@ static DWORD CALLBACK read_thread(void *arg)
IStream
*
stream
=
reader
->
source_stream
;
HANDLE
file
=
reader
->
file
;
size_t
buffer_size
=
4096
;
uint64_t
file_size
;
uint64_t
file_size
=
reader
->
file_size
;
void
*
data
;
if
(
!
(
data
=
malloc
(
buffer_size
)))
return
0
;
if
(
file
)
{
LARGE_INTEGER
size
;
GetFileSizeEx
(
file
,
&
size
);
file_size
=
size
.
QuadPart
;
}
else
{
STATSTG
stat
;
IStream_Stat
(
stream
,
&
stat
,
STATFLAG_NONAME
);
file_size
=
stat
.
cbSize
.
QuadPart
;
}
TRACE
(
"Starting read thread for reader %p.
\n
"
,
reader
);
while
(
!
reader
->
read_thread_shutdown
)
...
...
@@ -1453,7 +1439,7 @@ static const IWMReaderTimecodeVtbl timecode_vtbl =
timecode_GetTimecodeRangeBounds
,
};
static
HRESULT
init_stream
(
struct
wm_reader
*
reader
,
QWORD
file_size
)
static
HRESULT
init_stream
(
struct
wm_reader
*
reader
)
{
wg_parser_t
wg_parser
;
HRESULT
hr
;
...
...
@@ -1470,7 +1456,7 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
goto
out_destroy_parser
;
}
if
(
FAILED
(
hr
=
wg_parser_connect
(
reader
->
wg_parser
,
file_size
)))
if
(
FAILED
(
hr
=
wg_parser_connect
(
reader
->
wg_parser
,
reader
->
file_size
)))
{
ERR
(
"Failed to connect parser, hr %#lx.
\n
"
,
hr
);
goto
out_shutdown_thread
;
...
...
@@ -2134,8 +2120,9 @@ static HRESULT WINAPI reader_Open(IWMSyncReader2 *iface, const WCHAR *filename)
}
reader
->
file
=
file
;
reader
->
file_size
=
size
.
QuadPart
;
if
(
FAILED
(
hr
=
init_stream
(
reader
,
size
.
QuadPart
)))
if
(
FAILED
(
hr
=
init_stream
(
reader
)))
reader
->
file
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
...
...
@@ -2166,7 +2153,9 @@ static HRESULT WINAPI reader_OpenStream(IWMSyncReader2 *iface, IStream *stream)
}
IStream_AddRef
(
reader
->
source_stream
=
stream
);
if
(
FAILED
(
hr
=
init_stream
(
reader
,
stat
.
cbSize
.
QuadPart
)))
reader
->
file_size
=
stat
.
cbSize
.
QuadPart
;
if
(
FAILED
(
hr
=
init_stream
(
reader
)))
{
IStream_Release
(
stream
);
reader
->
source_stream
=
NULL
;
...
...
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