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
1babfe7d
Commit
1babfe7d
authored
Feb 16, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Avoid using gst_util_uint64_scale() in send_sample().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e848a00d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
2 deletions
+49
-2
gstdemux.c
dlls/winegstreamer/gstdemux.c
+49
-2
No files found.
dlls/winegstreamer/gstdemux.c
View file @
1babfe7d
...
...
@@ -566,6 +566,53 @@ static bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format)
return
false
;
}
/*
* scale_uint64() is based on gst_util_scale_int() from GStreamer, which is
* covered by the following license:
*
* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2002 Thomas Vander Stichele <thomas@apestaart.org>
* 2004 Wim Taymans <wim@fluendo.com>
* 2015 Jan Schmidt <jan@centricular.com>
*
* gstutils.c: Utility functions
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
static
uint64_t
scale_uint64
(
uint64_t
value
,
uint32_t
numerator
,
uint32_t
denominator
)
{
ULARGE_INTEGER
i
,
high
,
low
;
if
(
!
value
)
return
0
;
i
.
QuadPart
=
value
;
low
.
QuadPart
=
i
.
u
.
LowPart
*
numerator
;
high
.
QuadPart
=
i
.
u
.
HighPart
*
numerator
+
low
.
u
.
HighPart
;
low
.
u
.
HighPart
=
0
;
if
(
high
.
u
.
HighPart
>=
denominator
)
return
ULLONG_MAX
;
low
.
QuadPart
+=
(
high
.
QuadPart
%
denominator
)
<<
32
;
return
((
high
.
QuadPart
/
denominator
)
<<
32
)
+
(
low
.
QuadPart
/
denominator
);
}
/* Fill and send a single IMediaSample. */
static
HRESULT
send_sample
(
struct
parser_source
*
pin
,
IMediaSample
*
sample
,
const
struct
wg_parser_event
*
event
,
uint32_t
offset
,
uint32_t
size
,
DWORD
bytes_per_second
)
...
...
@@ -594,7 +641,7 @@ static HRESULT send_sample(struct parser_source *pin, IMediaSample *sample,
REFERENCE_TIME
start_pts
=
event
->
u
.
buffer
.
pts
;
if
(
offset
)
start_pts
+=
gst_util_uint64_scale
(
offset
,
10000000
,
bytes_per_second
);
start_pts
+=
scale_uint64
(
offset
,
10000000
,
bytes_per_second
);
start_pts
-=
pin
->
seek
.
llCurrent
;
start_pts
*=
pin
->
seek
.
dRate
;
...
...
@@ -603,7 +650,7 @@ static HRESULT send_sample(struct parser_source *pin, IMediaSample *sample,
REFERENCE_TIME
end_pts
=
event
->
u
.
buffer
.
pts
+
event
->
u
.
buffer
.
duration
;
if
(
offset
+
size
<
event
->
u
.
buffer
.
size
)
end_pts
=
event
->
u
.
buffer
.
pts
+
gst_util_uint64_scale
(
offset
+
size
,
10000000
,
bytes_per_second
);
end_pts
=
event
->
u
.
buffer
.
pts
+
scale_uint64
(
offset
+
size
,
10000000
,
bytes_per_second
);
end_pts
-=
pin
->
seek
.
llCurrent
;
end_pts
*=
pin
->
seek
.
dRate
;
...
...
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