Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
7261448e
Commit
7261448e
authored
Jun 26, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codec_fake: Fix potential crash (add and delete the callback at the right
moment).
parent
4ca174fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
modules/codec/fake.c
modules/codec/fake.c
+7
-2
No files found.
modules/codec/fake.c
View file @
7261448e
...
...
@@ -154,7 +154,6 @@ static int OpenDecoder( vlc_object_t *p_this )
free
(
p_dec
->
p_sys
);
return
VLC_EGENERIC
;
}
var_AddCallback
(
p_dec
,
"fake-file"
,
FakeCallback
,
p_dec
);
memset
(
&
fmt_in
,
0
,
sizeof
(
fmt_in
)
);
memset
(
&
fmt_out
,
0
,
sizeof
(
fmt_out
)
);
...
...
@@ -166,7 +165,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec
->
p_sys
->
i_reload
=
(
mtime_t
)(
val
.
i_int
*
1000000
);
p_dec
->
p_sys
->
i_next
=
(
mtime_t
)(
p_dec
->
p_sys
->
i_reload
+
mdate
());
}
var_AddCallback
(
p_dec
,
"fake-file-reload"
,
FakeCallback
,
p_dec
);
psz_chroma
=
var_CreateGetString
(
p_dec
,
"fake-chroma"
);
fmt_out
.
i_chroma
=
vlc_fourcc_GetCodecFromString
(
VIDEO_ES
,
psz_chroma
);
...
...
@@ -324,6 +322,10 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec
->
p_sys
->
p_image
=
p_image
;
vlc_mutex_init
(
&
p_dec
->
p_sys
->
lock
);
/* Add the callback when every variables are available */
var_AddCallback
(
p_dec
,
"fake-file"
,
FakeCallback
,
p_dec
);
var_AddCallback
(
p_dec
,
"fake-file-reload"
,
FakeCallback
,
p_dec
);
return
VLC_SUCCESS
;
}
...
...
@@ -370,6 +372,9 @@ static void CloseDecoder( vlc_object_t *p_this )
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
picture_t
*
p_image
=
p_dec
->
p_sys
->
p_image
;
var_DelCallback
(
p_dec
,
"fake-file"
,
FakeCallback
,
p_dec
);
var_DelCallback
(
p_dec
,
"fake-file-reload"
,
FakeCallback
,
p_dec
);
if
(
p_image
!=
NULL
)
picture_Release
(
p_image
);
...
...
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