aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-12-12 13:10:13 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-12-13 13:02:21 -0500
commitf266486b2e71d2965a19a505e83ead3cc1b198e0 (patch)
tree644a2fd14d2549092b419fc811d9852e97c6cb2d
parentbe75fed9755c1285ba084574aff2d7ee0f81110d (diff)
downloadffmpeg-f266486b2e71d2965a19a505e83ead3cc1b198e0.tar.gz
asyncts: fix flushing of final samples at EOF
-rw-r--r--libavfilter/af_asyncts.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
index 5d009f020b..67f3c4fdde 100644
--- a/libavfilter/af_asyncts.c
+++ b/libavfilter/af_asyncts.c
@@ -116,6 +116,12 @@ static int config_props(AVFilterLink *link)
return 0;
}
+/* get amount of data currently buffered, in samples */
+static int64_t get_delay(ASyncContext *s)
+{
+ return avresample_available(s->avr) + avresample_get_delay(s->avr);
+}
+
static int request_frame(AVFilterLink *link)
{
AVFilterContext *ctx = link->src;
@@ -128,7 +134,7 @@ static int request_frame(AVFilterLink *link)
ret = ff_request_frame(ctx->inputs[0]);
/* flush the fifo */
- if (ret == AVERROR_EOF && (nb_samples = avresample_get_delay(s->avr))) {
+ if (ret == AVERROR_EOF && (nb_samples = get_delay(s))) {
AVFilterBufferRef *buf = ff_get_audio_buffer(link, AV_PERM_WRITE,
nb_samples);
if (!buf)
@@ -155,12 +161,6 @@ static int write_to_fifo(ASyncContext *s, AVFilterBufferRef *buf)
return ret;
}
-/* get amount of data currently buffered, in samples */
-static int64_t get_delay(ASyncContext *s)
-{
- return avresample_available(s->avr) + avresample_get_delay(s->avr);
-}
-
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
{
AVFilterContext *ctx = inlink->dst;