Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
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
Steve Lhomme
VLC
Commits
4919758a
Commit
4919758a
authored
Aug 05, 2016
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Aug 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: only free the options if there were any
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
c4f14979
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
12 deletions
+16
-12
modules/access/avio.c
modules/access/avio.c
+2
-2
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.c
+3
-2
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+3
-2
modules/codec/avcodec/subtitle.c
modules/codec/avcodec/subtitle.c
+3
-2
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+2
-2
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+3
-2
No files found.
modules/access/avio.c
View file @
4919758a
...
...
@@ -158,7 +158,7 @@ int OpenAvio(vlc_object_t *object)
};
AVDictionary
*
options
=
NULL
;
char
*
psz_opts
=
var_InheritString
(
access
,
"avio-options"
);
if
(
psz_opts
&&
*
psz_opts
)
{
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
}
...
...
@@ -238,7 +238,7 @@ int OutOpenAvio(vlc_object_t *object)
#else
AVDictionary
*
options
=
NULL
;
char
*
psz_opts
=
var_InheritString
(
access
,
"sout-avio-options"
);
if
(
psz_opts
&&
*
psz_opts
)
{
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
}
...
...
modules/codec/avcodec/avcodec.c
View file @
4919758a
...
...
@@ -357,9 +357,10 @@ int ffmpeg_OpenCodec( decoder_t *p_dec )
AVDictionary
*
options
=
NULL
;
int
ret
;
if
(
psz_opts
&&
*
psz_opts
)
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
free
(
psz_opts
);
}
vlc_avcodec_lock
();
ret
=
avcodec_open2
(
p_sys
->
p_context
,
p_sys
->
p_codec
,
options
?
&
options
:
NULL
);
...
...
modules/codec/avcodec/encoder.c
View file @
4919758a
...
...
@@ -892,9 +892,10 @@ int OpenEncoder( vlc_object_t *p_this )
int
ret
;
char
*
psz_opts
=
var_InheritString
(
p_enc
,
ENC_CFG_PREFIX
"options"
);
AVDictionary
*
options
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
free
(
psz_opts
);
}
vlc_avcodec_lock
();
ret
=
avcodec_open2
(
p_context
,
p_codec
,
options
?
&
options
:
NULL
);
...
...
modules/codec/avcodec/subtitle.c
View file @
4919758a
...
...
@@ -89,9 +89,10 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
int
ret
;
char
*
psz_opts
=
var_InheritString
(
dec
,
"avcodec-options"
);
AVDictionary
*
options
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
free
(
psz_opts
);
}
vlc_avcodec_lock
();
ret
=
avcodec_open2
(
context
,
codec
,
options
?
&
options
:
NULL
);
...
...
modules/demux/avformat/demux.c
View file @
4919758a
...
...
@@ -336,13 +336,13 @@ int OpenDemux( vlc_object_t *p_this )
unsigned
int
nb_streams
=
p_sys
->
ic
->
nb_streams
;
for
(
unsigned
i
=
1
;
i
<
nb_streams
;
i
++
)
options
[
i
]
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
{
if
(
psz_opts
)
{
options
[
0
]
=
vlc_av_get_options
(
psz_opts
);
for
(
unsigned
i
=
1
;
i
<
nb_streams
;
i
++
)
{
av_dict_copy
(
&
options
[
i
],
options
[
0
],
0
);
}
free
(
psz_opts
);
}
free
(
psz_opts
);
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
error
=
avformat_find_stream_info
(
p_sys
->
ic
,
options
);
/* FIXME: what if nb_streams change after that call? */
...
...
modules/demux/avformat/mux.c
View file @
4919758a
...
...
@@ -378,9 +378,10 @@ static int Mux( sout_mux_t *p_mux )
char
*
psz_opts
=
var_GetNonEmptyString
(
p_mux
,
"sout-avformat-options"
);
AVDictionary
*
options
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
if
(
psz_opts
)
{
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
free
(
psz_opts
);
}
error
=
avformat_write_header
(
p_sys
->
oc
,
options
?
&
options
:
NULL
);
AVDictionaryEntry
*
t
=
NULL
;
while
((
t
=
av_dict_get
(
options
,
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
...
...
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