summaryrefslogtreecommitdiff
path: root/libavfilter/fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/fifo.c')
-rw-r--r--libavfilter/fifo.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index a414585ece..abfbba10bb 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -1,20 +1,20 @@
/*
* Copyright (c) 2007 Bobby Bingham
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -104,7 +104,7 @@ static void queue_pop(FifoContext *s)
static void buffer_offset(AVFilterLink *link, AVFrame *frame,
int offset)
{
- int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
+ int nb_channels = link->channels;
int planar = av_sample_fmt_is_planar(link->format);
int planes = planar ? nb_channels : 1;
int block_align = av_get_bytes_per_sample(link->format) * (planar ? 1 : nb_channels);
@@ -129,7 +129,7 @@ static void buffer_offset(AVFilterLink *link, AVFrame *frame,
static int calc_ptr_alignment(AVFrame *frame)
{
int planes = av_sample_fmt_is_planar(frame->format) ?
- av_get_channel_layout_nb_channels(frame->channel_layout) : 1;
+ av_frame_get_channels(frame) : 1;
int min_align = 128;
int p;
@@ -170,7 +170,7 @@ static int return_audio_frame(AVFilterContext *ctx)
buffer_offset(link, head, link->request_samples);
}
} else {
- int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
+ int nb_channels = link->channels;
if (!s->out) {
s->out = ff_get_audio_buffer(link, link->request_samples);
@@ -201,6 +201,8 @@ static int return_audio_frame(AVFilterContext *ctx)
break;
} else if (ret < 0)
return ret;
+ if (!s->root.next)
+ return 0;
}
head = s->root.next->frame;
@@ -236,6 +238,8 @@ static int request_frame(AVFilterLink *outlink)
return return_audio_frame(outlink->src);
return ret;
}
+ if (!fifo->root.next)
+ return 0;
}
if (outlink->request_samples) {
@@ -252,7 +256,6 @@ static const AVFilterPad avfilter_vf_fifo_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .get_video_buffer = ff_null_get_video_buffer,
.filter_frame = add_to_queue,
},
{ NULL }
@@ -284,7 +287,6 @@ static const AVFilterPad avfilter_af_afifo_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .get_audio_buffer = ff_null_get_audio_buffer,
.filter_frame = add_to_queue,
},
{ NULL }