Commit 0efcf16a authored by Michael Niedermayer's avatar Michael Niedermayer

replace av_log(0, by av_log(NULL,

The first parameter is a pointer and NULL is more correct
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c322f198
......@@ -991,7 +991,7 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs)
while ((desc = avcodec_descriptor_next(desc)))
nb_codecs++;
if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) {
av_log(0, AV_LOG_ERROR, "Out of memory\n");
av_log(NULL, AV_LOG_ERROR, "Out of memory\n");
exit(1);
}
desc = NULL;
......
......@@ -2251,7 +2251,7 @@ static int opt_progress(void *optctx, const char *opt, const char *arg)
arg = "pipe:";
ret = avio_open2(&avio, arg, AVIO_FLAG_WRITE, &int_cb, NULL);
if (ret < 0) {
av_log(0, AV_LOG_ERROR, "Failed to open progress URL \"%s\": %s\n",
av_log(NULL, AV_LOG_ERROR, "Failed to open progress URL \"%s\": %s\n",
arg, av_err2str(ret));
return ret;
}
......
......@@ -675,7 +675,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
} else {
quant_idx = q;
if (quant_idx > 15U) {
av_log(0, AV_LOG_ERROR, "quant_index %d out of range\n", quant_idx);
av_log(NULL, AV_LOG_ERROR, "quant_index %d out of range\n", quant_idx);
return AVERROR_INVALIDDATA;
}
}
......
......@@ -212,7 +212,7 @@ static int cin_decode_rle(const unsigned char *src, int src_size, unsigned char
} else {
len = code + 1;
if (len > src_end-src) {
av_log(0, AV_LOG_ERROR, "RLE overread\n");
av_log(NULL, AV_LOG_ERROR, "RLE overread\n");
return AVERROR_INVALIDDATA;
}
memcpy(dst, src, FFMIN(len, dst_end - dst));
......
......@@ -372,7 +372,7 @@ static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int pla
{
const uint64_t *lut = plane8_lut[plane];
if (plane >= 8) {
av_log(0, AV_LOG_WARNING, "Ignoring extra planes beyond 8\n");
av_log(NULL, AV_LOG_WARNING, "Ignoring extra planes beyond 8\n");
return;
}
do {
......
......@@ -643,12 +643,12 @@ int main(void){
continue;
}
if (skip) {
av_log(0, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
skip = 0;
}
av_log(0, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc), get_color_type(desc));
av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc), get_color_type(desc));
if ((!(desc->flags & PIX_FMT_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
av_log(0, AV_LOG_ERROR, "Alpha flag mismatch\n");
av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
err = 1;
}
}
......
......@@ -311,7 +311,7 @@ av_cold int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_hei
if (tile->num_MBs <= ref_tile->num_MBs) {
tile->ref_mbs = ref_tile->mbs;
}else
av_log(0, AV_LOG_DEBUG, "Cannot use ref_tile, too few mbs\n");
av_log(NULL, AV_LOG_DEBUG, "Cannot use ref_tile, too few mbs\n");
ref_tile++;
}
......@@ -466,7 +466,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
col_flags[0] |= !!prev_dc;
}
if(band->transform_size > band->blk_size){
av_log(0, AV_LOG_ERROR, "Too large transform\n");
av_log(NULL, AV_LOG_ERROR, "Too large transform\n");
return AVERROR_INVALIDDATA;
}
/* apply inverse transform */
......
......@@ -192,7 +192,7 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
goto the_end;
}
if (s->ebuf < s->pbuf) {
av_log(0, AV_LOG_ERROR, "lzw overread\n");
av_log(NULL, AV_LOG_ERROR, "lzw overread\n");
goto the_end;
}
c = lzw_get_code(s);
......
......@@ -268,7 +268,7 @@ static inline int l3_unscale(int value, int exponent)
e -= exponent >> 2;
#ifdef DEBUG
if(e < 1)
av_log(0, AV_LOG_WARNING, "l3_unscale: e is %d\n", e);
av_log(NULL, AV_LOG_WARNING, "l3_unscale: e is %d\n", e);
#endif
if (e > 31)
return 0;
......
......@@ -347,7 +347,7 @@ static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth)
int tmp;
if (value >= 60) {
av_log(0, AV_LOG_ERROR, "value %d in qdm2_get_vlc too large\n", value);
av_log(NULL, AV_LOG_ERROR, "value %d in qdm2_get_vlc too large\n", value);
return 0;
}
......@@ -1360,7 +1360,7 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
if (get_bits_left(gb)<0) {
if(local_int_4 < q->group_size)
av_log(0, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
av_log(NULL, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
return;
}
offset = 1;
......
......@@ -62,7 +62,7 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
dst->audio->channel_layout = src->channel_layout;
dst->audio->channels = src->channels;
if(src->channels < av_get_channel_layout_nb_channels(src->channel_layout)) {
av_log(0, AV_LOG_ERROR, "libavfilter does not support this channel layout\n");
av_log(NULL, AV_LOG_ERROR, "libavfilter does not support this channel layout\n");
return AVERROR(EINVAL);
}
break;
......
......@@ -69,7 +69,7 @@ do {
for (j = 0; j < b->nb; j++) \
if (a->fmts[i] == b->fmts[j]) { \
if(k >= FFMIN(a->nb, b->nb)){ \
av_log(0, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n"); \
av_log(NULL, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n"); \
av_free(ret->fmts); \
av_free(ret); \
return NULL; \
......
......@@ -1062,7 +1062,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
uint8_t *header = encodings[0].compression.settings.data;
if (header_size && !header) {
av_log(0, AV_LOG_ERROR, "Compression size but no data in headerstrip\n");
av_log(NULL, AV_LOG_ERROR, "Compression size but no data in headerstrip\n");
return -1;
}
......
......@@ -237,7 +237,7 @@ int ffio_limit(AVIOContext *s, int size)
}
if(s->maxsize>=0 && remaining+1 < size){
av_log(0, remaining ? AV_LOG_ERROR : AV_LOG_DEBUG, "Truncating packet of size %d to %"PRId64"\n", size, remaining+1);
av_log(NULL, remaining ? AV_LOG_ERROR : AV_LOG_DEBUG, "Truncating packet of size %d to %"PRId64"\n", size, remaining+1);
size= remaining+1;
}
}
......@@ -547,7 +547,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
if (!s && !(s = avformat_alloc_context()))
return AVERROR(ENOMEM);
if (!s->av_class){
av_log(0, AV_LOG_ERROR, "Input context has not been properly allocated by avformat_alloc_context() and is not NULL either\n");
av_log(NULL, AV_LOG_ERROR, "Input context has not been properly allocated by avformat_alloc_context() and is not NULL either\n");
return AVERROR(EINVAL);
}
if (fmt)
......
......@@ -277,7 +277,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
int h = height;
int bwidth = av_image_get_linesize(pix_fmt, width, i);
if (bwidth < 0) {
av_log(0, AV_LOG_ERROR, "av_image_get_linesize failed\n");
av_log(NULL, AV_LOG_ERROR, "av_image_get_linesize failed\n");
return;
}
if (i == 1 || i == 2) {
......
......@@ -160,11 +160,11 @@ int main(void)
else if (d < 0) d = -1;
else if (d != d) d = INT_MIN;
if (c != d)
av_log(0, AV_LOG_ERROR, "%d/%d %d/%d, %d %f\n", a.num,
av_log(NULL, AV_LOG_ERROR, "%d/%d %d/%d, %d %f\n", a.num,
a.den, b.num, b.den, c,d);
r = av_sub_q(av_add_q(b,a), b);
if(b.den && (r.num*a.den != a.num*r.den || !r.num != !a.num || !r.den != !a.den))
av_log(0, AV_LOG_ERROR, "%d/%d ", r.num, r.den);
av_log(NULL, AV_LOG_ERROR, "%d/%d ", r.num, r.den);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment