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
6942d7a0
Commit
6942d7a0
authored
Jun 18, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move stream length query to BeginCreateObject.
parent
5b1a2014
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
media_source.c
dlls/winegstreamer/media_source.c
+13
-11
No files found.
dlls/winegstreamer/media_source.c
View file @
6942d7a0
...
...
@@ -34,6 +34,7 @@ struct object_context
IMFAsyncResult
*
result
;
IMFByteStream
*
stream
;
UINT64
file_size
;
WCHAR
*
url
;
};
...
...
@@ -94,7 +95,7 @@ static const IUnknownVtbl object_context_vtbl =
};
static
HRESULT
object_context_create
(
DWORD
flags
,
IMFByteStream
*
stream
,
const
WCHAR
*
url
,
IMFAsyncResult
*
result
,
IUnknown
**
out
)
QWORD
file_size
,
IMFAsyncResult
*
result
,
IUnknown
**
out
)
{
WCHAR
*
tmp_url
=
url
?
wcsdup
(
url
)
:
NULL
;
struct
object_context
*
context
;
...
...
@@ -109,6 +110,7 @@ static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const W
context
->
refcount
=
1
;
context
->
stream
=
stream
;
IMFByteStream_AddRef
(
context
->
stream
);
context
->
file_size
=
file_size
;
context
->
url
=
tmp_url
;
context
->
result
=
result
;
IMFAsyncResult_AddRef
(
context
->
result
);
...
...
@@ -181,6 +183,7 @@ struct media_source
CRITICAL_SECTION
cs
;
struct
wg_parser
*
wg_parser
;
UINT64
file_size
;
UINT64
duration
;
IMFStreamDescriptor
**
descriptors
;
...
...
@@ -1615,16 +1618,9 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc
unsigned
int
stream_count
=
UINT_MAX
;
struct
media_source
*
object
;
struct
wg_parser
*
parser
;
QWORD
file_size
;
unsigned
int
i
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFByteStream_GetLength
(
context
->
stream
,
&
file_size
)))
{
FIXME
(
"Failed to get byte stream length, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
...
...
@@ -1636,6 +1632,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc
object
->
ref
=
1
;
object
->
byte_stream
=
context
->
stream
;
IMFByteStream_AddRef
(
context
->
stream
);
object
->
file_size
=
context
->
file_size
;
object
->
rate
=
1
.
0
f
;
InitializeCriticalSection
(
&
object
->
cs
);
object
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": cs"
);
...
...
@@ -1663,7 +1660,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc
object
->
state
=
SOURCE_OPENING
;
if
(
FAILED
(
hr
=
wg_parser_connect
(
parser
,
file_size
)))
if
(
FAILED
(
hr
=
wg_parser_connect
(
parser
,
object
->
file_size
)))
goto
fail
;
stream_count
=
wg_parser_get_stream_count
(
parser
);
...
...
@@ -1859,6 +1856,7 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
struct
stream_handler
*
handler
=
impl_from_IMFByteStreamHandler
(
iface
);
IMFAsyncResult
*
result
;
IUnknown
*
context
;
QWORD
file_size
;
HRESULT
hr
;
DWORD
caps
;
...
...
@@ -1879,11 +1877,15 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
FIXME
(
"Non-seekable bytestreams not supported.
\n
"
);
return
MF_E_BYTESTREAM_NOT_SEEKABLE
;
}
if
(
FAILED
(
hr
=
IMFByteStream_GetLength
(
stream
,
&
file_size
)))
{
FIXME
(
"Failed to get byte stream length, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
callback
,
state
,
&
result
)))
return
hr
;
if
(
FAILED
(
hr
=
object_context_create
(
flags
,
stream
,
url
,
result
,
&
context
)))
if
(
FAILED
(
hr
=
object_context_create
(
flags
,
stream
,
url
,
file_size
,
result
,
&
context
)))
{
IMFAsyncResult_Release
(
result
);
return
hr
;
...
...
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