diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-09-12 11:44:42 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:16:46 +0200 |
commit | fe6c4fcae203e6f95ae654acf80f912185c853da (patch) | |
tree | 22f073c1bcb6888cadb0ca3ce351d5eb6b06b9fd /libmpcodecs/vd_ffmpeg.c | |
parent | fcdeaadeaebdddcb2d743ecdafacea36e7260e36 (diff) | |
download | mpv-fe6c4fcae203e6f95ae654acf80f912185c853da.tar.bz2 mpv-fe6c4fcae203e6f95ae654acf80f912185c853da.tar.xz |
cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr)
Replace malloc+memset by calloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32181 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32182 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32183 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace some sizeof(type) by sizeof(*pointer)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32184 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32186 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32187 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32188 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace sizoef(type) by sizeof(*ptrvar).
Besides being consistent with FFmpeg style,
this reduces the size of a patch to rename these
types to not conflict with the windows.h definitions.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32189 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32191 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32192 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace sizeof(type) by sizeof(*ptrvar)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32193 b3059339-0415-0410-9bf9-f77b7e298cf2
Remove a useless cast.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32194 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace sizeof(type)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32195 b3059339-0415-0410-9bf9-f77b7e298cf2
Remove a useless cast.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32196 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace several sizeof(WAVEFORMATEX)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32197 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace one more instance of sizeof(WAVEFORMATEX); fix compilation.
patch by Clément Bœsch, ubitux gmail com
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32199 b3059339-0415-0410-9bf9-f77b7e298cf2
Avoid some pointless uses of sizeof() and one related cast.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32200 b3059339-0415-0410-9bf9-f77b7e298cf2
Merge one malloc() + memset() invocation into calloc().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32202 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32203 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace sizeof(WAVEFORMATEX) occurrences.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32205 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace malloc+memset by calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32206 b3059339-0415-0410-9bf9-f77b7e298cf2
Replace sizeof(BITMAPINFOHEADER)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 30ee162743..1bb7c2e94b 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -294,10 +294,10 @@ static int init(sh_video_t *sh){ /* AVRn stores huffman table in AVI header */ /* Pegasus MJPEG stores it also in AVI header, but it uses the common MJPG fourcc :( */ - if (!sh->bih || sh->bih->biSize <= sizeof(BITMAPINFOHEADER)) + if (!sh->bih || sh->bih->biSize <= sizeof(*sh->bih)) break; avctx->flags |= CODEC_FLAG_EXTERN_HUFF; - avctx->extradata_size = sh->bih->biSize-sizeof(BITMAPINFOHEADER); + avctx->extradata_size = sh->bih->biSize-sizeof(*sh->bih); avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size); @@ -327,7 +327,7 @@ static int init(sh_video_t *sh){ (sh->format == mmioFOURCC('R', 'V', '1', '3')) ? 0x10003001 : 0x10000000; } else { /* has extra slice header (demux_rm or rm->avi streamcopy) */ - avctx->extradata_size = sh->bih->biSize-sizeof(BITMAPINFOHEADER); + avctx->extradata_size = sh->bih->biSize-sizeof(*sh->bih); avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size); } @@ -337,9 +337,9 @@ static int init(sh_video_t *sh){ break; default: - if (!sh->bih || sh->bih->biSize <= sizeof(BITMAPINFOHEADER)) + if (!sh->bih || sh->bih->biSize <= sizeof(*sh->bih)) break; - avctx->extradata_size = sh->bih->biSize-sizeof(BITMAPINFOHEADER); + avctx->extradata_size = sh->bih->biSize-sizeof(*sh->bih); avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size); break; @@ -348,10 +348,10 @@ static int init(sh_video_t *sh){ if (sh->bih && (sh->bih->biBitCount <= 8)) { avctx->palctrl = calloc(1, sizeof(AVPaletteControl)); avctx->palctrl->palette_changed = 1; - if (sh->bih->biSize-sizeof(BITMAPINFOHEADER)) + if (sh->bih->biSize-sizeof(*sh->bih)) /* Palette size in biSize */ memcpy(avctx->palctrl->palette, sh->bih+1, - FFMIN(sh->bih->biSize-sizeof(BITMAPINFOHEADER), AVPALETTE_SIZE)); + FFMIN(sh->bih->biSize-sizeof(*sh->bih), AVPALETTE_SIZE)); else /* Palette size in biClrUsed */ memcpy(avctx->palctrl->palette, sh->bih+1, |