mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-02 02:30:58 +00:00
avconv: merge two loops in output_packet().
This commit is contained in:
parent
f1176d41af
commit
2886aee73f
28
avconv.c
28
avconv.c
@ -1552,25 +1552,6 @@ static int output_packet(InputStream *ist, int ist_index,
|
|||||||
avpkt.size = 0;
|
avpkt.size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_AVFILTER
|
|
||||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
|
|
||||||
for (i = 0; i < nb_ostreams; i++) {
|
|
||||||
ost = &ost_table[i];
|
|
||||||
if (ost->input_video_filter && ost->source_index == ist_index) {
|
|
||||||
AVRational sar;
|
|
||||||
if (ist->st->sample_aspect_ratio.num)
|
|
||||||
sar = ist->st->sample_aspect_ratio;
|
|
||||||
else
|
|
||||||
sar = ist->st->codec->sample_aspect_ratio;
|
|
||||||
// add it to be filtered
|
|
||||||
av_vsrc_buffer_add_frame(ost->input_video_filter, &picture,
|
|
||||||
ist->pts,
|
|
||||||
sar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// preprocess audio (volume)
|
// preprocess audio (volume)
|
||||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
if (audio_volume != 256) {
|
if (audio_volume != 256) {
|
||||||
@ -1603,6 +1584,15 @@ static int output_packet(InputStream *ist, int ist_index,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
|
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||||
|
ost->input_video_filter) {
|
||||||
|
AVRational sar;
|
||||||
|
if (ist->st->sample_aspect_ratio.num)
|
||||||
|
sar = ist->st->sample_aspect_ratio;
|
||||||
|
else
|
||||||
|
sar = ist->st->codec->sample_aspect_ratio;
|
||||||
|
av_vsrc_buffer_add_frame(ost->input_video_filter, &picture, ist->pts, sar);
|
||||||
|
}
|
||||||
frame_available = ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO ||
|
frame_available = ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO ||
|
||||||
!ost->output_video_filter || avfilter_poll_frame(ost->output_video_filter->inputs[0]);
|
!ost->output_video_filter || avfilter_poll_frame(ost->output_video_filter->inputs[0]);
|
||||||
while (frame_available) {
|
while (frame_available) {
|
||||||
|
Loading…
Reference in New Issue
Block a user