Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bfa143a2
Commit
bfa143a2
authored
Nov 02, 2020
by
Esme Povirk
Committed by
Alexandre Julliard
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Only add the first stream reference to the parent.
Signed-off-by:
Esme Povirk
<
esme@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfa4c079
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
avifile.c
dlls/avifil32/avifile.c
+2
-2
api.c
dlls/avifil32/tests/api.c
+33
-1
No files found.
dlls/avifil32/avifile.c
View file @
bfa143a2
...
...
@@ -699,7 +699,7 @@ static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
/* also add ref to parent, so that it doesn't kill us */
if
(
This
->
paf
!=
NULL
)
if
(
This
->
paf
!=
NULL
&&
ref
==
1
)
IAVIFile_AddRef
(
&
This
->
paf
->
IAVIFile_iface
);
return
ref
;
...
...
@@ -712,7 +712,7 @@ static ULONG WINAPI IAVIStream_fnRelease(IAVIStream *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
This
->
paf
!=
NULL
)
if
(
This
->
paf
!=
NULL
&&
ref
==
0
)
IAVIFile_Release
(
&
This
->
paf
->
IAVIFile_iface
);
return
ref
;
...
...
dlls/avifil32/tests/api.c
View file @
bfa143a2
...
...
@@ -352,6 +352,12 @@ static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
CloseHandle
(
hFile
);
}
static
ULONG
get_file_refcount
(
PAVIFILE
file
)
{
AVIFileAddRef
(
file
);
return
AVIFileRelease
(
file
);
}
static
void
test_default_data
(
void
)
{
COMMON_AVI_HEADERS
cah
;
...
...
@@ -363,6 +369,7 @@ static void test_default_data(void)
PAVISTREAM
pStream1
;
AVISTREAMINFOA
asi0
,
asi1
;
WAVEFORMATEX
wfx
;
ULONG
refcount
;
GetTempPathA
(
MAX_PATH
,
filename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
...
...
@@ -443,9 +450,34 @@ static void test_default_data(void)
ok
(
wfx
.
nAvgBytesPerSec
==
22050
,
"got %u (expected 22050)
\n
"
,
wfx
.
nAvgBytesPerSec
);
ok
(
wfx
.
nBlockAlign
==
2
,
"got %u (expected 2)
\n
"
,
wfx
.
nBlockAlign
);
refcount
=
get_file_refcount
(
pFile
);
ok
(
refcount
==
3
,
"got %u (expected 3)
\n
"
,
refcount
);
AVIStreamRelease
(
pStream0
);
refcount
=
get_file_refcount
(
pFile
);
ok
(
refcount
==
2
,
"got %u (expected 2)
\n
"
,
refcount
);
AVIStreamAddRef
(
pStream1
);
refcount
=
get_file_refcount
(
pFile
);
ok
(
refcount
==
2
,
"got %u (expected 2)
\n
"
,
refcount
);
AVIStreamRelease
(
pStream1
);
AVIFileRelease
(
pFile
);
AVIStreamRelease
(
pStream1
);
refcount
=
get_file_refcount
(
pFile
);
ok
(
refcount
==
1
,
"got %u (expected 1)
\n
"
,
refcount
);
refcount
=
AVIStreamRelease
(
pStream1
);
ok
(
refcount
==
(
ULONG
)
-
1
,
"got %u (expected 4294967295)
\n
"
,
refcount
);
refcount
=
get_file_refcount
(
pFile
);
ok
(
refcount
==
1
,
"got %u (expected 1)
\n
"
,
refcount
);
refcount
=
AVIFileRelease
(
pFile
);
ok
(
refcount
==
0
,
"got %u (expected 0)
\n
"
,
refcount
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
}
...
...
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