Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1da54e90
Commit
1da54e90
authored
Feb 21, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: use a local variable for OutputFile in open_output_file().
This is shorter and more readable.
parent
9d3009c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
avconv_opt.c
avconv_opt.c
+15
-12
No files found.
avconv_opt.c
View file @
1da54e90
...
...
@@ -1173,6 +1173,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
AVFormatContext
*
oc
;
int
i
,
j
,
err
;
AVOutputFormat
*
file_oformat
;
OutputFile
*
of
;
OutputStream
*
ost
;
InputStream
*
ist
;
...
...
@@ -1365,18 +1366,20 @@ loop_end:
}
GROW_ARRAY
(
output_files
,
nb_output_files
);
if
(
!
(
output_files
[
nb_output_files
-
1
]
=
av_mallocz
(
sizeof
(
*
output_files
[
0
]))))
of
=
av_mallocz
(
sizeof
(
*
of
));
if
(
!
of
)
exit
(
1
);
output_files
[
nb_output_files
-
1
]
=
of
;
o
utput_files
[
nb_output_files
-
1
]
->
ctx
=
oc
;
o
utput_files
[
nb_output_files
-
1
]
->
ost_index
=
nb_output_streams
-
oc
->
nb_streams
;
o
utput_files
[
nb_output_files
-
1
]
->
recording_time
=
o
->
recording_time
;
o
f
->
ctx
=
oc
;
o
f
->
ost_index
=
nb_output_streams
-
oc
->
nb_streams
;
o
f
->
recording_time
=
o
->
recording_time
;
if
(
o
->
recording_time
!=
INT64_MAX
)
oc
->
duration
=
o
->
recording_time
;
o
utput_files
[
nb_output_files
-
1
]
->
start_time
=
o
->
start_time
;
o
utput_files
[
nb_output_files
-
1
]
->
limit_filesize
=
o
->
limit_filesize
;
o
utput_files
[
nb_output_files
-
1
]
->
shortest
=
o
->
shortest
;
av_dict_copy
(
&
o
utput_files
[
nb_output_files
-
1
]
->
opts
,
o
->
g
->
format_opts
,
0
);
o
f
->
start_time
=
o
->
start_time
;
o
f
->
limit_filesize
=
o
->
limit_filesize
;
o
f
->
shortest
=
o
->
shortest
;
av_dict_copy
(
&
o
f
->
opts
,
o
->
g
->
format_opts
,
0
);
/* check filename in case of an image number is expected */
if
(
oc
->
oformat
->
flags
&
AVFMT_NEEDNUMBER
)
{
...
...
@@ -1393,7 +1396,7 @@ loop_end:
/* open the file */
if
((
err
=
avio_open2
(
&
oc
->
pb
,
filename
,
AVIO_FLAG_WRITE
,
&
oc
->
interrupt_callback
,
&
o
utput_files
[
nb_output_files
-
1
]
->
opts
))
<
0
)
{
&
o
f
->
opts
))
<
0
)
{
print_error
(
filename
,
err
);
exit
(
1
);
}
...
...
@@ -1402,7 +1405,7 @@ loop_end:
if
(
o
->
mux_preload
)
{
uint8_t
buf
[
64
];
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
(
int
)(
o
->
mux_preload
*
AV_TIME_BASE
));
av_dict_set
(
&
o
utput_files
[
nb_output_files
-
1
]
->
opts
,
"preload"
,
buf
,
0
);
av_dict_set
(
&
o
f
->
opts
,
"preload"
,
buf
,
0
);
}
oc
->
max_delay
=
(
int
)(
o
->
mux_max_delay
*
AV_TIME_BASE
);
oc
->
flags
|=
AVFMT_FLAG_NONBLOCK
;
...
...
@@ -1438,7 +1441,7 @@ loop_end:
}
}
if
(
o
->
chapters_input_file
>=
0
)
copy_chapters
(
input_files
[
o
->
chapters_input_file
],
o
utput_files
[
nb_output_files
-
1
]
,
copy_chapters
(
input_files
[
o
->
chapters_input_file
],
o
f
,
!
o
->
metadata_chapters_manual
);
/* copy global metadata by default */
...
...
@@ -1446,7 +1449,7 @@ loop_end:
av_dict_copy
(
&
oc
->
metadata
,
input_files
[
0
]
->
ctx
->
metadata
,
AV_DICT_DONT_OVERWRITE
);
if
(
!
o
->
metadata_streams_manual
)
for
(
i
=
o
utput_files
[
nb_output_files
-
1
]
->
ost_index
;
i
<
nb_output_streams
;
i
++
)
{
for
(
i
=
o
f
->
ost_index
;
i
<
nb_output_streams
;
i
++
)
{
InputStream
*
ist
;
if
(
output_streams
[
i
]
->
source_index
<
0
)
/* this is true e.g. for attached files */
continue
;
...
...
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