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
13b965ea
Commit
13b965ea
authored
Aug 19, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: reindent after last commit.
parent
429c6cab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
62 deletions
+61
-62
ffmpeg.c
ffmpeg.c
+61
-62
No files found.
ffmpeg.c
View file @
13b965ea
...
...
@@ -963,76 +963,75 @@ static int reap_filters(void)
int
i
;
int64_t
frame_pts
;
/* TODO reindent */
/* Reap all buffers present in the buffer sinks */
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
OutputStream
*
ost
=
output_streams
[
i
];
OutputFile
*
of
=
output_files
[
ost
->
file_index
];
int
ret
=
0
;
if
(
!
ost
->
filter
)
continue
;
/* Reap all buffers present in the buffer sinks */
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
OutputStream
*
ost
=
output_streams
[
i
];
OutputFile
*
of
=
output_files
[
ost
->
file_index
];
int
ret
=
0
;
if
(
!
ost
->
filtered_frame
&&
!
(
ost
->
filtered_frame
=
avcodec_alloc_frame
()))
{
return
AVERROR
(
ENOMEM
);
}
else
avcodec_get_frame_defaults
(
ost
->
filtered_frame
);
filtered_frame
=
ost
->
filtered_frame
;
if
(
!
ost
->
filter
)
continue
;
while
(
1
)
{
ret
=
av_buffersink_get_buffer_ref
(
ost
->
filter
->
filter
,
&
picref
,
AV_BUFFERSINK_FLAG_NO_REQUEST
);
if
(
ret
<
0
)
{
if
(
ret
!=
AVERROR
(
EAGAIN
)
&&
ret
!=
AVERROR_EOF
)
{
char
buf
[
256
];
av_strerror
(
ret
,
buf
,
sizeof
(
buf
));
av_log
(
NULL
,
AV_LOG_WARNING
,
"Error in av_buffersink_get_buffer_ref(): %s
\n
"
,
buf
);
}
break
;
if
(
!
ost
->
filtered_frame
&&
!
(
ost
->
filtered_frame
=
avcodec_alloc_frame
()))
{
return
AVERROR
(
ENOMEM
);
}
else
avcodec_get_frame_defaults
(
ost
->
filtered_frame
);
filtered_frame
=
ost
->
filtered_frame
;
while
(
1
)
{
ret
=
av_buffersink_get_buffer_ref
(
ost
->
filter
->
filter
,
&
picref
,
AV_BUFFERSINK_FLAG_NO_REQUEST
);
if
(
ret
<
0
)
{
if
(
ret
!=
AVERROR
(
EAGAIN
)
&&
ret
!=
AVERROR_EOF
)
{
char
buf
[
256
];
av_strerror
(
ret
,
buf
,
sizeof
(
buf
));
av_log
(
NULL
,
AV_LOG_WARNING
,
"Error in av_buffersink_get_buffer_ref(): %s
\n
"
,
buf
);
}
frame_pts
=
AV_NOPTS_VALUE
;
if
(
picref
->
pts
!=
AV_NOPTS_VALUE
)
{
filtered_frame
->
pts
=
frame_pts
=
av_rescale_q
(
picref
->
pts
,
ost
->
filter
->
filter
->
inputs
[
0
]
->
time_base
,
ost
->
st
->
codec
->
time_base
)
-
av_rescale_q
(
of
->
start_time
,
AV_TIME_BASE_Q
,
ost
->
st
->
codec
->
time_base
);
if
(
of
->
start_time
&&
filtered_frame
->
pts
<
0
)
{
avfilter_unref_buffer
(
picref
);
continue
;
}
break
;
}
frame_pts
=
AV_NOPTS_VALUE
;
if
(
picref
->
pts
!=
AV_NOPTS_VALUE
)
{
filtered_frame
->
pts
=
frame_pts
=
av_rescale_q
(
picref
->
pts
,
ost
->
filter
->
filter
->
inputs
[
0
]
->
time_base
,
ost
->
st
->
codec
->
time_base
)
-
av_rescale_q
(
of
->
start_time
,
AV_TIME_BASE_Q
,
ost
->
st
->
codec
->
time_base
);
if
(
of
->
start_time
&&
filtered_frame
->
pts
<
0
)
{
avfilter_unref_buffer
(
picref
);
continue
;
}
//if (ost->source_index >= 0)
// *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
switch
(
ost
->
filter
->
filter
->
inputs
[
0
]
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
avfilter_copy_buf_props
(
filtered_frame
,
picref
);
filtered_frame
->
pts
=
frame_pts
;
if
(
!
ost
->
frame_aspect_ratio
)
ost
->
st
->
codec
->
sample_aspect_ratio
=
picref
->
video
->
sample_aspect_ratio
;
}
//if (ost->source_index >= 0)
// *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
do_video_out
(
of
->
ctx
,
ost
,
filtered_frame
,
same_quant
?
ost
->
last_quality
:
ost
->
st
->
codec
->
global_quality
);
break
;
case
AVMEDIA_TYPE_AUDIO
:
avfilter_copy_buf_props
(
filtered_frame
,
picref
);
filtered_frame
->
pts
=
frame_pts
;
do_audio_out
(
of
->
ctx
,
ost
,
filtered_frame
);
break
;
default:
// TODO support subtitle filters
av_assert0
(
0
);
}
avfilter_unref_buffer
(
picref
);
switch
(
ost
->
filter
->
filter
->
inputs
[
0
]
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
avfilter_copy_buf_props
(
filtered_frame
,
picref
);
filtered_frame
->
pts
=
frame_pts
;
if
(
!
ost
->
frame_aspect_ratio
)
ost
->
st
->
codec
->
sample_aspect_ratio
=
picref
->
video
->
sample_aspect_ratio
;
do_video_out
(
of
->
ctx
,
ost
,
filtered_frame
,
same_quant
?
ost
->
last_quality
:
ost
->
st
->
codec
->
global_quality
);
break
;
case
AVMEDIA_TYPE_AUDIO
:
avfilter_copy_buf_props
(
filtered_frame
,
picref
);
filtered_frame
->
pts
=
frame_pts
;
do_audio_out
(
of
->
ctx
,
ost
,
filtered_frame
);
break
;
default:
// TODO support subtitle filters
av_assert0
(
0
);
}
avfilter_unref_buffer
(
picref
);
}
}
return
0
;
}
...
...
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