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
740e6042
Commit
740e6042
authored
Jan 17, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: change ost->finished to an enum
Idea-by: ramiro Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d73f8976
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
ffmpeg.c
ffmpeg.c
+4
-4
ffmpeg.h
ffmpeg.h
+6
-1
No files found.
ffmpeg.c
View file @
740e6042
...
...
@@ -548,7 +548,7 @@ static void update_benchmark(const char *fmt, ...)
}
}
static
void
close_all_output_streams
(
OutputStream
*
ost
,
int
this_stream
,
int
others
)
static
void
close_all_output_streams
(
OutputStream
*
ost
,
OSTFinished
this_stream
,
OSTFinished
others
)
{
int
i
;
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
...
...
@@ -658,7 +658,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
if
(
ret
<
0
)
{
print_error
(
"av_interleaved_write_frame()"
,
ret
);
main_return_code
=
1
;
close_all_output_streams
(
ost
,
3
,
1
);
close_all_output_streams
(
ost
,
MUXER_FINISHED
|
ENCODER_FINISHED
,
ENCODER_FINISHED
);
}
}
...
...
@@ -666,7 +666,7 @@ static void close_output_stream(OutputStream *ost)
{
OutputFile
*
of
=
output_files
[
ost
->
file_index
];
ost
->
finished
|=
1
;
ost
->
finished
|=
ENCODER_FINISHED
;
if
(
of
->
shortest
)
{
int64_t
end
=
av_rescale_q
(
ost
->
sync_opts
-
ost
->
first_pts
,
ost
->
st
->
codec
->
time_base
,
AV_TIME_BASE_Q
);
of
->
recording_time
=
FFMIN
(
of
->
recording_time
,
end
);
...
...
@@ -1388,7 +1388,7 @@ static void flush_encoders(void)
stop_encoding
=
1
;
break
;
}
if
(
ost
->
finished
>
1
)
{
if
(
ost
->
finished
&
MUXER_FINISHED
)
{
av_free_packet
(
&
pkt
);
continue
;
}
...
...
ffmpeg.h
View file @
740e6042
...
...
@@ -344,6 +344,11 @@ enum forced_keyframes_const {
extern
const
char
*
const
forced_keyframes_const_names
[];
typedef
enum
{
ENCODER_FINISHED
=
1
,
MUXER_FINISHED
=
2
,
}
OSTFinished
;
typedef
struct
OutputStream
{
int
file_index
;
/* file index */
int
index
;
/* stream index in the output file */
...
...
@@ -397,7 +402,7 @@ typedef struct OutputStream {
AVDictionary
*
swr_opts
;
AVDictionary
*
resample_opts
;
char
*
apad
;
int
finished
;
/* no more packets should be written for this stream */
OSTFinished
finished
;
/* no more packets should be written for this stream */
int
unavailable
;
/* true if the steram is unavailable (possibly temporarily) */
int
stream_copy
;
const
char
*
attachment_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