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
7e046aa4
Commit
7e046aa4
authored
Jul 05, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Release requested samples if they are too small.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
7187965a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
wg_allocator.c
dlls/winegstreamer/wg_allocator.c
+7
-1
wg_transform.c
dlls/winegstreamer/wg_transform.c
+1
-6
No files found.
dlls/winegstreamer/wg_allocator.c
View file @
7e046aa4
...
...
@@ -150,6 +150,7 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size,
GstAllocationParams
*
params
)
{
WgAllocator
*
allocator
=
(
WgAllocator
*
)
gst_allocator
;
struct
wg_sample
*
sample
;
WgMemory
*
memory
;
GST_LOG
(
"allocator %p, size %#zx, params %p"
,
allocator
,
size
,
params
);
...
...
@@ -162,7 +163,12 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size,
pthread_mutex_lock
(
&
allocator
->
mutex
);
memory
->
sample
=
allocator
->
request_sample
(
size
,
allocator
->
request_sample_context
);
sample
=
allocator
->
request_sample
(
size
,
allocator
->
request_sample_context
);
if
(
sample
->
max_size
<
size
)
InterlockedDecrement
(
&
sample
->
refcount
);
else
memory
->
sample
=
sample
;
list_add_tail
(
&
allocator
->
memory_list
,
&
memory
->
entry
);
pthread_mutex_unlock
(
&
allocator
->
mutex
);
...
...
dlls/winegstreamer/wg_transform.c
View file @
7e046aa4
...
...
@@ -310,15 +310,10 @@ static bool transform_append_element(struct wg_transform *transform, GstElement
static
struct
wg_sample
*
transform_request_sample
(
gsize
size
,
void
*
context
)
{
struct
wg_transform
*
transform
=
context
;
struct
wg_sample
*
sample
;
GST_LOG
(
"size %#zx, context %p"
,
size
,
transform
);
sample
=
InterlockedExchangePointer
((
void
**
)
&
transform
->
output_wg_sample
,
NULL
);
if
(
!
sample
||
sample
->
max_size
<
size
)
return
NULL
;
return
sample
;
return
InterlockedExchangePointer
((
void
**
)
&
transform
->
output_wg_sample
,
NULL
);
}
NTSTATUS
wg_transform_create
(
void
*
args
)
...
...
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