lavc: factorize ff_{thread_,re,}get_buffer error messages.

Coccinelle profile used:

  @@
  expression r, ctx, f, loglevel, str, flags;
  @@

  -if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_get_buffer(ctx, f, flags)) < 0)
  +    return r;

  @@
  expression r, ctx, f, loglevel, str;
  @@

  -if ((r = ff_reget_buffer(ctx, f)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_reget_buffer(ctx, f)) < 0)
  +    return r;

  @@
  expression r, ctx, f, loglevel, str, flags;
  @@

  -if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
  +    return r;

...along with some manual patches for the remaining ones.
This commit is contained in:
Clément Bœsch
2013-03-12 08:41:53 +01:00
parent e7279638e8
commit 1ec94b0f06
191 changed files with 273 additions and 669 deletions

View File

@@ -111,11 +111,8 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data,
int16_t *pcm;
frame->nb_samples = c->frame_size;
err = ff_get_buffer(c, frame, 0);
if (err < 0) {
av_log(c, AV_LOG_ERROR, "get_buffer() failed\n");
if ((err = ff_get_buffer(c, frame, 0)) < 0)
return err;
}
pcm = (int16_t *)frame->data[0];
err = celt_decode(celt->dec, pkt->data, pkt->size, pcm, c->frame_size);
if (err < 0)