Merge commit 'd3cfd7aff86ee3d449ca68aba21d67b9b2136a9b'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Jul 2014 11:20:08 +0000 (13:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Jul 2014 11:48:26 +0000 (13:48 +0200)
* commit 'd3cfd7aff86ee3d449ca68aba21d67b9b2136a9b':
  af_compand: make sure request_frame always outputs at least one frame

See: 6b68e2a43b3407522080be50a2a19cff2f9715ef
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavfilter/af_compand.c

@@@ -278,7 -289,15 +278,13 @@@ static int compand_delay(AVFilterContex
      s->delay_index = dindex;
  
      av_frame_free(&frame);
-     return out_frame ? ff_filter_frame(ctx->outputs[0], out_frame) : 0;
+     if (out_frame) {
+         err = ff_filter_frame(ctx->outputs[0], out_frame);
 -        if (err >= 0)
 -            s->got_output = 1;
+         return err;
+     }
+     return 0;
  }
  
  static int compand_drain(AVFilterLink *outlink)
@@@ -534,11 -569,13 +540,11 @@@ static int request_frame(AVFilterLink *
  {
      AVFilterContext *ctx = outlink->src;
      CompandContext *s    = ctx->priv;
-     int ret;
+     int ret = 0;
  
 -    s->got_output = 0;
 -    while (ret >= 0 && !s->got_output)
 -        ret = ff_request_frame(ctx->inputs[0]);
 +    ret = ff_request_frame(ctx->inputs[0]);
  
 -    if (ret == AVERROR_EOF && s->delay_count)
 +    if (ret == AVERROR_EOF && !ctx->is_disabled && s->delay_count)
          ret = compand_drain(outlink);
  
      return ret;