[FFmpeg-devel] [PATCHv2] lavc: factorize ff_{thread_, re, }get_buffer error messages.

Paul B Mahol onemda at gmail.com
Wed Mar 13 11:13:56 CET 2013


On 3/12/13, Clement Boesch <ubitux at gmail.com> wrote:
> 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.
> ---
> Changes from previous version:
>  - back to return -1 in vp56: the res variable was being used for something
>    else. I've re-checked every single entry in case I did the same mistake
>    elsewhere
>  - squashed the two patches
>  - various trivial changes
> ---
>  libavcodec/4xm.c              |  8 ++------
>  libavcodec/8bps.c             |  4 +---
>  libavcodec/8svx.c             |  4 +---
>  libavcodec/aacdec.c           |  4 +---
>  libavcodec/aasc.c             |  4 +---
>  libavcodec/ac3dec.c           |  4 +---
>  libavcodec/adpcm.c            |  4 +---
>  libavcodec/adxdec.c           |  4 +---
>  libavcodec/alac.c             |  4 +---
>  libavcodec/alsdec.c           |  4 +---
>  libavcodec/amrnbdec.c         |  4 +---
>  libavcodec/amrwbdec.c         |  4 +---
>  libavcodec/anm.c              |  4 +---
>  libavcodec/ansi.c             | 11 +++--------
>  libavcodec/apedec.c           |  4 +---
>  libavcodec/asvdec.c           |  4 +---
>  libavcodec/atrac1.c           |  4 +---
>  libavcodec/atrac3.c           |  4 +---
>  libavcodec/aura.c             |  4 +---
>  libavcodec/avrndec.c          |  4 +---
>  libavcodec/avs.c              |  4 +---
>  libavcodec/bethsoftvideo.c    |  4 +---
>  libavcodec/bfi.c              |  4 +---
>  libavcodec/bink.c             |  8 ++------
>  libavcodec/binkaudio.c        |  4 +---
>  libavcodec/bintext.c          |  6 ++----
>  libavcodec/bmp.c              |  4 +---
>  libavcodec/bmv.c              |  8 ++------
>  libavcodec/brender_pix.c      |  4 +---
>  libavcodec/c93.c              |  4 +---
>  libavcodec/cdgraphics.c       | 10 ++--------
>  libavcodec/cdxl.c             |  4 +---
>  libavcodec/cinepak.c          |  4 +---
>  libavcodec/cljr.c             |  4 +---
>  libavcodec/cngdec.c           |  4 +---
>  libavcodec/cook.c             |  4 +---
>  libavcodec/cpia.c             |  4 +---
>  libavcodec/crystalhd.c        |  4 +---
>  libavcodec/cscd.c             |  4 +---
>  libavcodec/cyuv.c             |  4 +---
>  libavcodec/dcadec.c           |  4 +---
>  libavcodec/dfa.c              |  4 +---
>  libavcodec/diracdec.c         |  8 +++-----
>  libavcodec/dnxhddec.c         |  4 +---
>  libavcodec/dpcm.c             |  4 +---
>  libavcodec/dpx.c              |  4 +---
>  libavcodec/dsicinav.c         |  4 +---
>  libavcodec/dvdec.c            |  8 +++-----
>  libavcodec/dxa.c              |  4 +---
>  libavcodec/eacmv.c            |  4 +---
>  libavcodec/eamad.c            |  4 +---
>  libavcodec/eatgq.c            |  4 +---
>  libavcodec/eatqi.c            |  4 +---
>  libavcodec/escape124.c        |  4 +---
>  libavcodec/escape130.c        |  6 ++----
>  libavcodec/exr.c              |  4 +---
>  libavcodec/ffv1dec.c          |  4 +---
>  libavcodec/flacdec.c          |  4 +---
>  libavcodec/flashsv.c          |  4 +---
>  libavcodec/flicvideo.c        |  8 ++------
>  libavcodec/fraps.c            |  4 +---
>  libavcodec/frwu.c             |  4 +---
>  libavcodec/g722dec.c          |  4 +---
>  libavcodec/g723_1.c           |  6 ++----
>  libavcodec/g726.c             |  4 +---
>  libavcodec/g729dec.c          |  4 +---
>  libavcodec/gifdec.c           |  8 ++------
>  libavcodec/gsmdec.c           |  4 +---
>  libavcodec/huffyuvdec.c       |  4 +---
>  libavcodec/idcinvideo.c       |  4 +---
>  libavcodec/iff.c              |  4 +---
>  libavcodec/imc.c              |  4 +---
>  libavcodec/indeo2.c           |  4 +---
>  libavcodec/indeo3.c           |  4 +---
>  libavcodec/interplayvideo.c   |  4 +---
>  libavcodec/ivi_common.c       |  4 +---
>  libavcodec/jvdec.c            |  4 +---
>  libavcodec/kmvc.c             |  4 +---
>  libavcodec/lagarith.c         | 16 ++++------------
>  libavcodec/lcldec.c           |  4 +---
>  libavcodec/libcelt_dec.c      |  5 +----
>  libavcodec/libgsm.c           |  4 +---
>  libavcodec/libilbc.c          |  4 +---
>  libavcodec/libopencore-amr.c  |  8 ++------
>  libavcodec/libopenjpegdec.c   |  4 +---
>  libavcodec/libopusdec.c       |  5 +----
>  libavcodec/libspeexdec.c      |  4 +---
>  libavcodec/libstagefright.cpp |  1 -
>  libavcodec/libvorbisdec.c     |  4 +---
>  libavcodec/loco.c             |  4 +---
>  libavcodec/mace.c             |  4 +---
>  libavcodec/mdec.c             |  4 +---
>  libavcodec/mimic.c            |  4 +---
>  libavcodec/mjpegdec.c         |  4 +---
>  libavcodec/mlpdec.c           |  4 +---
>  libavcodec/mmvideo.c          |  4 +---
>  libavcodec/motionpixels.c     |  4 +---
>  libavcodec/mpc7.c             |  4 +---
>  libavcodec/mpc8.c             |  4 +---
>  libavcodec/mpegaudiodec.c     |  8 ++------
>  libavcodec/msrle.c            |  4 +---
>  libavcodec/mss1.c             |  4 +---
>  libavcodec/mss2.c             |  8 ++------
>  libavcodec/mss3.c             |  4 +---
>  libavcodec/mss4.c             |  4 +---
>  libavcodec/msvideo1.c         |  4 +---
>  libavcodec/mvcdec.c           |  7 ++-----
>  libavcodec/mxpegdec.c         | 16 ++++++----------
>  libavcodec/nellymoserdec.c    |  4 +---
>  libavcodec/nuv.c              |  5 +----
>  libavcodec/pcm-mpeg.c         |  4 +---
>  libavcodec/pcm.c              |  4 +---
>  libavcodec/pcx.c              |  4 +---
>  libavcodec/pictordec.c        |  4 +---
>  libavcodec/pngdec.c           |  4 +---
>  libavcodec/pnmdec.c           |  4 +---
>  libavcodec/pthread.c          | 10 +++++++++-
>  libavcodec/ptx.c              |  4 +---
>  libavcodec/qcelpdec.c         |  4 +---
>  libavcodec/qdm2.c             |  4 +---
>  libavcodec/qdrw.c             |  4 +---
>  libavcodec/qpeg.c             |  4 +---
>  libavcodec/qtrle.c            |  4 +---
>  libavcodec/ra144dec.c         |  4 +---
>  libavcodec/ra288.c            |  4 +---
>  libavcodec/ralf.c             |  4 +---
>  libavcodec/rl2.c              |  4 +---
>  libavcodec/roqvideodec.c      |  4 +---
>  libavcodec/roqvideoenc.c      |  8 +++-----
>  libavcodec/rpza.c             |  4 +---
>  libavcodec/s302m.c            |  4 +---
>  libavcodec/sanm.c             |  4 +---
>  libavcodec/sgidec.c           |  6 ++----
>  libavcodec/sgirledec.c        |  5 +----
>  libavcodec/shorten.c          |  4 +---
>  libavcodec/sipr.c             |  4 +---
>  libavcodec/smacker.c          |  8 ++------
>  libavcodec/smc.c              |  4 +---
>  libavcodec/snow.c             | 13 +++++--------
>  libavcodec/sonic.c            |  4 +---
>  libavcodec/sunrast.c          |  4 +---
>  libavcodec/targa.c            |  4 +---
>  libavcodec/tiertexseqv.c      |  4 +---
>  libavcodec/tiff.c             |  4 +---
>  libavcodec/tmv.c              |  4 +---
>  libavcodec/truemotion1.c      |  4 +---
>  libavcodec/truemotion2.c      |  4 +---
>  libavcodec/truespeech.c       |  4 +---
>  libavcodec/tscc.c             |  4 +---
>  libavcodec/tscc2.c            |  4 +---
>  libavcodec/tta.c              |  4 +---
>  libavcodec/twinvq.c           |  4 +---
>  libavcodec/txd.c              |  4 +---
>  libavcodec/ulti.c             |  4 +---
>  libavcodec/utils.c            | 20 ++++++++++++++++++--
>  libavcodec/utvideodec.c       |  4 +---
>  libavcodec/vb.c               |  4 +---
>  libavcodec/vc1dec.c           |  7 +++----
>  libavcodec/vcr1.c             |  4 +---
>  libavcodec/vima.c             |  4 +---
>  libavcodec/vmdav.c            |  8 ++------
>  libavcodec/vmnc.c             |  4 +---
>  libavcodec/vorbisdec.c        |  4 +---
>  libavcodec/vp3.c              |  8 ++------
>  libavcodec/vp56.c             |  4 +---
>  libavcodec/vp8.c              |  4 +---
>  libavcodec/vqavideo.c         |  4 +---
>  libavcodec/wavpack.c          |  4 +---
>  libavcodec/wmadec.c           |  4 +---
>  libavcodec/wmaprodec.c        |  1 -
>  libavcodec/wmavoice.c         |  4 +---
>  libavcodec/wnv1.c             |  1 -
>  libavcodec/ws-snd1.c          |  4 +---
>  libavcodec/xan.c              |  4 +---
>  libavcodec/xl.c               |  4 +---
>  libavcodec/xwddec.c           |  4 +---
>  libavcodec/xxan.c             |  4 +---
>  libavcodec/yop.c              |  5 +----
>  libavcodec/zmbv.c             |  4 +---
>  179 files changed, 240 insertions(+), 610 deletions(-)
>

Should be ok if nothing breaks.

Thanks for doing extremly boring task.


More information about the ffmpeg-devel mailing list