Commit a9b42487 authored by Paul B Mahol's avatar Paul B Mahol

lavc & lavf: replace deprecated av_log* functions

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 3d751b1e
...@@ -30,7 +30,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx) ...@@ -30,7 +30,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
avctx->bits_per_raw_sample = 10; avctx->bits_per_raw_sample = 10;
if (avctx->codec_tag == MKTAG('a', '1', '2', 'v')) if (avctx->codec_tag == MKTAG('a', '1', '2', 'v'))
av_log_ask_for_sample(avctx, "Samples with actual transparency needed\n"); avpriv_request_sample(avctx, "transparency");
return 0; return 0;
} }
......
...@@ -323,7 +323,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1, ...@@ -323,7 +323,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1,
shift = 12 - (in[4+i*2] & 15); shift = 12 - (in[4+i*2] & 15);
filter = in[4+i*2] >> 4; filter = in[4+i*2] >> 4;
if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) { if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) {
av_log_ask_for_sample(avctx, "unknown XA-ADPCM filter %d\n", filter); avpriv_request_sample(avctx, "unknown XA-ADPCM filter %d", filter);
filter=0; filter=0;
} }
f0 = xa_adpcm_table[filter][0]; f0 = xa_adpcm_table[filter][0];
...@@ -352,7 +352,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1, ...@@ -352,7 +352,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1,
shift = 12 - (in[5+i*2] & 15); shift = 12 - (in[5+i*2] & 15);
filter = in[5+i*2] >> 4; filter = in[5+i*2] >> 4;
if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) { if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) {
av_log_ask_for_sample(avctx, "unknown XA-ADPCM filter %d\n", filter); avpriv_request_sample(avctx, "unknown XA-ADPCM filter %d", filter);
filter=0; filter=0;
} }
......
...@@ -342,7 +342,7 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx) ...@@ -342,7 +342,7 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
} }
if (avctx->block_align <= 0) { if (avctx->block_align <= 0) {
av_log_ask_for_sample(avctx, "unsupported block align\n"); av_log(avctx, AV_LOG_ERROR, "Unsupported block align.");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -1202,7 +1202,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) ...@@ -1202,7 +1202,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
if (q->subpacket[s].subbands == 0) { if (q->subpacket[s].subbands == 0) {
av_log_ask_for_sample(avctx, "subbands is 0\n"); avpriv_request_sample(avctx, "subbands = 0");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
q->subpacket[s].gains1.now = q->subpacket[s].gain_1; q->subpacket[s].gains1.now = q->subpacket[s].gain_1;
......
...@@ -739,7 +739,7 @@ static int dca_parse_frame_header(DCAContext *s) ...@@ -739,7 +739,7 @@ static int dca_parse_frame_header(DCAContext *s)
if (s->lfe == 3) { if (s->lfe == 3) {
s->lfe = 0; s->lfe = 0;
av_log_ask_for_sample(s->avctx, "LFE is 3\n"); avpriv_request_sample(s->avctx, "LFE = 3");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -1012,7 +1012,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) ...@@ -1012,7 +1012,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
/* Scale factor index */ /* Scale factor index */
quant7 = get_bits(&s->gb, 8); quant7 = get_bits(&s->gb, 8);
if (quant7 > 127) { if (quant7 > 127) {
av_log_ask_for_sample(s->avctx, "LFEScaleIndex larger than 127\n"); avpriv_request_sample(s->avctx, "LFEScaleIndex larger than 127");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->lfe_scale_factor = scale_factor_quant7[quant7]; s->lfe_scale_factor = scale_factor_quant7[quant7];
...@@ -2167,7 +2167,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, ...@@ -2167,7 +2167,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
} }
if (s->xch_base_channel < 2) { if (s->xch_base_channel < 2) {
av_log_ask_for_sample(avctx, "XCh with fewer than 2 base channels is not supported\n"); avpriv_request_sample(avctx, "XCh with fewer than 2 base channels");
continue; continue;
} }
......
...@@ -697,7 +697,7 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -697,7 +697,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = AV_PIX_FMT_RGB48; avctx->pix_fmt = AV_PIX_FMT_RGB48;
break; break;
case EXR_UINT: case EXR_UINT:
av_log_missing_feature(avctx, "32-bit unsigned int", 1); avpriv_request_sample(avctx, "32-bit unsigned int");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
default: default:
av_log(avctx, AV_LOG_ERROR, "Missing channel list\n"); av_log(avctx, AV_LOG_ERROR, "Missing channel list\n");
......
...@@ -345,7 +345,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -345,7 +345,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
} else if (avctx->bits_per_coded_sample == 32) { } else if (avctx->bits_per_coded_sample == 32) {
avctx->pix_fmt = AV_PIX_FMT_BGR32; avctx->pix_fmt = AV_PIX_FMT_BGR32;
} else { } else {
av_log_ask_for_sample(avctx, "unknown bits_per_coded_sample\n"); avpriv_request_sample(avctx, "unknown bits_per_coded_sample");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
} }
...@@ -646,7 +646,7 @@ static void decode_deep_tvdc32(uint8_t *dst, const uint8_t *src, int src_size, i ...@@ -646,7 +646,7 @@ static void decode_deep_tvdc32(uint8_t *dst, const uint8_t *src, int src_size, i
static int unsupported(AVCodecContext *avctx) static int unsupported(AVCodecContext *avctx)
{ {
IffContext *s = avctx->priv_data; IffContext *s = avctx->priv_data;
av_log_ask_for_sample(avctx, "unsupported bitmap (compression %i, bpp %i, ham %i)\n", s->compression, s->bpp, s->ham); avpriv_request_sample(avctx, "bitmap (compression %i, bpp %i, ham %i)", s->compression, s->bpp, s->ham);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -330,7 +330,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) ...@@ -330,7 +330,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) { if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
if (s->progressive) { if (s->progressive) {
av_log_ask_for_sample(s->avctx, "progressively coded interlaced pictures not supported\n"); avpriv_request_sample(s->avctx, "progressively coded interlaced picture");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} else{ } else{
......
...@@ -209,7 +209,7 @@ static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g) ...@@ -209,7 +209,7 @@ static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g)
if (g->block_type == 2) { if (g->block_type == 2) {
if (g->switch_point) { if (g->switch_point) {
if(s->sample_rate_index == 8) if(s->sample_rate_index == 8)
av_log_ask_for_sample(s->avctx, "switch point in 8khz\n"); avpriv_request_sample(s->avctx, "switch point in 8khz");
/* if switched mode, we handle the 36 first samples as /* if switched mode, we handle the 36 first samples as
long blocks. For 8000Hz, we handle the 72 first long blocks. For 8000Hz, we handle the 72 first
exponents as long blocks */ exponents as long blocks */
......
...@@ -150,7 +150,7 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s ...@@ -150,7 +150,7 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s
av_log(avctx, AV_LOG_WARNING, "dimension mismatch\n"); av_log(avctx, AV_LOG_WARNING, "dimension mismatch\n");
if (bytestream2_get_byteu(gb)) { if (bytestream2_get_byteu(gb)) {
av_log_ask_for_sample(avctx, "bitmap feature\n"); avpriv_request_sample(avctx, "bitmap feature");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -342,7 +342,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data, ...@@ -342,7 +342,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
} }
break; break;
default: default:
av_log_ask_for_sample(avctx, "unknown/invalid code\n"); avpriv_request_sample(avctx, "unknown/invalid code");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -646,7 +646,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra ...@@ -646,7 +646,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
if (!superblocktype_2_3) { if (!superblocktype_2_3) {
/* This case is untested, no samples available */ /* This case is untested, no samples available */
av_log_ask_for_sample(NULL, "!superblocktype_2_3"); avpriv_request_sample(NULL, "!superblocktype_2_3");
return; return;
for (ch = 0; ch < nb_channels; ch++) for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++) { for (sb = 0; sb < 30; sb++) {
......
...@@ -68,7 +68,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx) ...@@ -68,7 +68,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLT; avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
if (avctx->block_align <= 0) { if (avctx->block_align <= 0) {
av_log_ask_for_sample(avctx, "unsupported block align\n"); av_log(avctx, AV_LOG_ERROR, "unsupported block align\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -760,7 +760,7 @@ static int process_frame_obj(SANMVideoContext *ctx) ...@@ -760,7 +760,7 @@ static int process_frame_obj(SANMVideoContext *ctx)
return old_codec47(ctx, top, left, w, h); return old_codec47(ctx, top, left, w, h);
break; break;
default: default:
av_log_ask_for_sample(ctx->avctx, "unknown subcodec %d\n", codec); avpriv_request_sample(ctx->avctx, "unknown subcodec %d", codec);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
} }
...@@ -784,7 +784,7 @@ static int decode_0(SANMVideoContext *ctx) ...@@ -784,7 +784,7 @@ static int decode_0(SANMVideoContext *ctx)
static int decode_nop(SANMVideoContext *ctx) static int decode_nop(SANMVideoContext *ctx)
{ {
av_log_ask_for_sample(ctx->avctx, "unknown/unsupported compression type\n"); avpriv_request_sample(ctx->avctx, "unknown/unsupported compression type");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -1271,7 +1271,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, ...@@ -1271,7 +1271,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return ret; return ret;
} }
} else { } else {
av_log_ask_for_sample(avctx, "subcodec %d is not implemented\n", avpriv_request_sample(avctx, "subcodec %d",
header.codec); header.codec);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -101,7 +101,7 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *sr ...@@ -101,7 +101,7 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *sr
v -= length; v -= length;
} while (v > 0); } while (v > 0);
} else { } else {
av_log_ask_for_sample(avctx, "unknown opcode\n"); avpriv_request_sample(avctx, "opcode %d", v);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
} }
......
...@@ -5287,7 +5287,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) ...@@ -5287,7 +5287,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
v->output_height > 1 << 14) return -1; v->output_height > 1 << 14) return -1;
if ((v->sprite_width&1) || (v->sprite_height&1)) { if ((v->sprite_width&1) || (v->sprite_height&1)) {
av_log_ask_for_sample(avctx, "odd sprites are not supported\n"); avpriv_request_sample(avctx, "odd sprites support");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
} }
......
...@@ -38,7 +38,7 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx) ...@@ -38,7 +38,7 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV410P; avctx->pix_fmt = AV_PIX_FMT_YUV410P;
if (avctx->width % 8 || avctx->height%4) { if (avctx->width % 8 || avctx->height%4) {
av_log_ask_for_sample(avctx, "odd dimensions are not supported\n"); avpriv_request_sample(avctx, "odd dimensions support");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
return 0; return 0;
......
...@@ -50,7 +50,7 @@ static int ast_read_header(AVFormatContext *s) ...@@ -50,7 +50,7 @@ static int ast_read_header(AVFormatContext *s)
depth = avio_rb16(s->pb); depth = avio_rb16(s->pb);
if (depth != 16) { if (depth != 16) {
av_log_ask_for_sample(s, "unsupported depth %d\n", depth); avpriv_request_sample(s, "depth %d", depth);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -51,7 +51,7 @@ static int avr_read_header(AVFormatContext *s) ...@@ -51,7 +51,7 @@ static int avr_read_header(AVFormatContext *s)
} else if (chan == 0xFFFFu) { } else if (chan == 0xFFFFu) {
st->codec->channels = 2; st->codec->channels = 2;
} else { } else {
av_log_ask_for_sample(s, "unknown number of channels\n"); avpriv_request_sample(s, "chan %d", chan);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -78,7 +78,7 @@ static int avr_read_header(AVFormatContext *s) ...@@ -78,7 +78,7 @@ static int avr_read_header(AVFormatContext *s)
} else if (sign == 0xFFFFu && bps == 16) { } else if (sign == 0xFFFFu && bps == 16) {
st->codec->codec_id = AV_CODEC_ID_PCM_S16BE; st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
} else { } else {
av_log_ask_for_sample(s, "unknown bits per sample\n"); avpriv_request_sample(s, "bits per sample %d", bps);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -75,7 +75,7 @@ static int read_header(AVFormatContext *s) ...@@ -75,7 +75,7 @@ static int read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (bom == 0xFFFE) { if (bom == 0xFFFE) {
av_log_ask_for_sample(s, "unsupported byte order\n"); avpriv_request_sample(s, "little endian byte order");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -110,7 +110,7 @@ static int read_header(AVFormatContext *s) ...@@ -110,7 +110,7 @@ static int read_header(AVFormatContext *s)
case 1: codec = AV_CODEC_ID_PCM_S16BE_PLANAR; break; case 1: codec = AV_CODEC_ID_PCM_S16BE_PLANAR; break;
case 2: codec = AV_CODEC_ID_ADPCM_THP; break; case 2: codec = AV_CODEC_ID_ADPCM_THP; break;
default: default:
av_log_ask_for_sample(s, "unsupported codec: %d\n", codec); avpriv_request_sample(s, "codec %d", codec);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -220,8 +220,8 @@ static int read_header(AVFormatContext *s) ...@@ -220,8 +220,8 @@ static int read_header(AVFormatContext *s)
} }
avio_skip(s->pb, start - avio_tell(s->pb)); avio_skip(s->pb, start - avio_tell(s->pb));
if (major!=1 || minor) if (major != 1 || minor)
av_log_ask_for_sample(s, "Version %d.%d\n", major, minor); avpriv_request_sample(s, "Version %d.%d", major, minor);
return 0; return 0;
default: default:
......
...@@ -184,7 +184,7 @@ static int process_audio_header_elements(AVFormatContext *s) ...@@ -184,7 +184,7 @@ static int process_audio_header_elements(AVFormatContext *s)
case 3: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R3; break; case 3: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R3; break;
case -1: break; case -1: break;
default: default:
av_log_ask_for_sample(s, "unsupported stream type; revision=%i\n", revision); avpriv_request_sample(s, "stream type; revision=%i", revision);
return 0; return 0;
} }
switch (revision2) { switch (revision2) {
...@@ -195,7 +195,7 @@ static int process_audio_header_elements(AVFormatContext *s) ...@@ -195,7 +195,7 @@ static int process_audio_header_elements(AVFormatContext *s)
case 2: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R1; break; case 2: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R1; break;
case 3: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2; break; case 3: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2; break;
default: default:
av_log_ask_for_sample(s, "unsupported stream type; revision=%i, revision2=%i\n", revision, revision2); avpriv_request_sample(s, "stream type; revision=%i, revision2=%i", revision, revision2);
return 0; return 0;
} }
break; break;
...@@ -203,12 +203,12 @@ static int process_audio_header_elements(AVFormatContext *s) ...@@ -203,12 +203,12 @@ static int process_audio_header_elements(AVFormatContext *s)
case -1: break; case -1: break;
default: default:
ea->audio_codec = AV_CODEC_ID_NONE; ea->audio_codec = AV_CODEC_ID_NONE;
av_log_ask_for_sample(s, "unsupported stream type; revision2=%i\n", revision2); avpriv_request_sample(s, "stream type; revision2=%i", revision2);
return 0; return 0;
} }
break; break;
default: default:
av_log_ask_for_sample(s, "unsupported stream type; compression_type=%i\n", compression_type); avpriv_request_sample(s, "stream type; compression_type=%i", compression_type);
return 0; return 0;
} }
...@@ -244,7 +244,7 @@ static int process_audio_header_eacs(AVFormatContext *s) ...@@ -244,7 +244,7 @@ static int process_audio_header_eacs(AVFormatContext *s)
case 1: ea->audio_codec = AV_CODEC_ID_PCM_MULAW; ea->bytes = 1; break; case 1: ea->audio_codec = AV_CODEC_ID_PCM_MULAW; ea->bytes = 1; break;
case 2: ea->audio_codec = AV_CODEC_ID_ADPCM_IMA_EA_EACS; break; case 2: ea->audio_codec = AV_CODEC_ID_ADPCM_IMA_EA_EACS; break;
default: default:
av_log_ask_for_sample(s, "unsupported stream type; audio compression_type=%i\n", compression_type); avpriv_request_sample(s, "stream type; audio compression_type=%i", compression_type);
} }
return 1; return 1;
...@@ -332,7 +332,7 @@ static int process_ea_header(AVFormatContext *s) { ...@@ -332,7 +332,7 @@ static int process_ea_header(AVFormatContext *s) {
switch (blockid) { switch (blockid) {
case ISNh_TAG: case ISNh_TAG:
if (avio_rl32(pb) != EACS_TAG) { if (avio_rl32(pb) != EACS_TAG) {
av_log_ask_for_sample(s, "unknown 1SNh headerid\n"); avpriv_request_sample(s, "unknown 1SNh headerid");
return 0; return 0;
} }
err = process_audio_header_eacs(s); err = process_audio_header_eacs(s);
...@@ -344,7 +344,7 @@ static int process_ea_header(AVFormatContext *s) { ...@@ -344,7 +344,7 @@ static int process_ea_header(AVFormatContext *s) {
if (blockid == GSTR_TAG) { if (blockid == GSTR_TAG) {
avio_skip(pb, 4); avio_skip(pb, 4);
} else if ((blockid & 0xFFFF)!=PT00_TAG) { } else if ((blockid & 0xFFFF)!=PT00_TAG) {
av_log_ask_for_sample(s, "unknown SCHl headerid\n"); avpriv_request_sample(s, "unknown SCHl headerid");
return 0; return 0;
} }
err = process_audio_header_elements(s); err = process_audio_header_elements(s);
...@@ -531,7 +531,7 @@ static int ea_read_packet(AVFormatContext *s, ...@@ -531,7 +531,7 @@ static int ea_read_packet(AVFormatContext *s,
chunk_size -= 12; chunk_size -= 12;
} }
if (partial_packet) { if (partial_packet) {
av_log_ask_for_sample(s, "video header followed by audio packet not supported.\n"); avpriv_request_sample(s, "video header followed by audio packet");
av_free_packet(pkt); av_free_packet(pkt);
partial_packet = 0; partial_packet = 0;
} }
......
...@@ -77,7 +77,7 @@ static int epaf_read_header(AVFormatContext *s) ...@@ -77,7 +77,7 @@ static int epaf_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_PCM_S8; st->codec->codec_id = AV_CODEC_ID_PCM_S8;
break; break;
case 1: case 1:
av_log_missing_feature(s, "24-bit Paris PCM format", 1); avpriv_request_sample(s, "24-bit Paris PCM format");
default: default:
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -53,7 +53,7 @@ static int read_header(AVFormatContext *s) ...@@ -53,7 +53,7 @@ static int read_header(AVFormatContext *s)
{ {
IcoDemuxContext *ico = s->priv_data; IcoDemuxContext *ico = s->priv_data;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
int i; int i, codec;
avio_skip(pb, 4); avio_skip(pb, 4);
ico->nb_images = avio_rl16(pb); ico->nb_images = avio_rl16(pb);
...@@ -88,7 +88,8 @@ static int read_header(AVFormatContext *s) ...@@ -88,7 +88,8 @@ static int read_header(AVFormatContext *s)
if (avio_seek(pb, ico->images[i].offset, SEEK_SET) < 0) if (avio_seek(pb, ico->images[i].offset, SEEK_SET) < 0)
break; break;
switch(avio_rl32(pb)) { codec = avio_rl32(pb);
switch (codec) {
case MKTAG(0x89, 'P', 'N', 'G'): case MKTAG(0x89, 'P', 'N', 'G'):
st->codec->codec_id = AV_CODEC_ID_PNG; st->codec->codec_id = AV_CODEC_ID_PNG;
st->codec->width = 0; st->codec->width = 0;
...@@ -106,7 +107,7 @@ static int read_header(AVFormatContext *s) ...@@ -106,7 +107,7 @@ static int read_header(AVFormatContext *s)
st->codec->height = tmp / 2; st->codec->height = tmp / 2;
break; break;
default: default:
av_log_ask_for_sample(s, "unsupported codec\n"); avpriv_request_sample(s, "codec %d", codec);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} }
......
...@@ -298,7 +298,7 @@ static int iff_read_header(AVFormatContext *s) ...@@ -298,7 +298,7 @@ static int iff_read_header(AVFormatContext *s)
else if (fmt_size == sizeof(deep_abgr) && !memcmp(fmt, deep_abgr, sizeof(deep_abgr))) else if (fmt_size == sizeof(deep_abgr) && !memcmp(fmt, deep_abgr, sizeof(deep_abgr)))
st->codec->pix_fmt = AV_PIX_FMT_ABGR; st->codec->pix_fmt = AV_PIX_FMT_ABGR;
else { else {
av_log_ask_for_sample(s, "unsupported color format\n"); avpriv_request_sample(s, "color format %.16s", fmt);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
break; break;
...@@ -364,7 +364,7 @@ static int iff_read_header(AVFormatContext *s) ...@@ -364,7 +364,7 @@ static int iff_read_header(AVFormatContext *s)
} else if (iff->maud_bits == 8 && iff->maud_compression == 3) { } else if (iff->maud_bits == 8 && iff->maud_compression == 3) {
st->codec->codec_id = AV_CODEC_ID_PCM_MULAW; st->codec->codec_id = AV_CODEC_ID_PCM_MULAW;
} else { } else {
av_log_ask_for_sample(s, "unsupported compression %d and bit depth %d\n", iff->maud_compression, iff->maud_bits); avpriv_request_sample(s, "compression %d and bit depth %d", iff->maud_compression, iff->maud_bits);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -41,7 +41,7 @@ static int lvf_read_header(AVFormatContext *s) ...@@ -41,7 +41,7 @@ static int lvf_read_header(AVFormatContext *s)
if (!nb_streams) if (!nb_streams)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (nb_streams > 2) { if (nb_streams > 2) {
av_log_ask_for_sample(s, "too many streams\n"); avpriv_request_sample(s, "%d streams", nb_streams);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -87,7 +87,7 @@ static int lvf_read_header(AVFormatContext *s) ...@@ -87,7 +87,7 @@ static int lvf_read_header(AVFormatContext *s)
avio_seek(s->pb, 2048 + 8, SEEK_SET); avio_seek(s->pb, 2048 + 8, SEEK_SET);
return 0; return 0;
default: default:
av_log_ask_for_sample(s, "unknown id\n"); avpriv_request_sample(s, "id %d", id);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -130,7 +130,7 @@ static int get_packet_header(AVFormatContext *s) ...@@ -130,7 +130,7 @@ static int get_packet_header(AVFormatContext *s)
version = bytestream_get_le32(&p); version = bytestream_get_le32(&p);
header_size = bytestream_get_le32(&p); header_size = bytestream_get_le32(&p);
if (version > 1) if (version > 1)
av_log_ask_for_sample(s, "Unknown format version %i\n", version); avpriv_request_sample(s, "format version %i", version);
if (header_size < (version ? 72 : 60) || if (header_size < (version ? 72 : 60) ||
header_size > LXF_MAX_PACKET_HEADER_SIZE || header_size > LXF_MAX_PACKET_HEADER_SIZE ||
(header_size & 3)) { (header_size & 3)) {
......
...@@ -172,7 +172,7 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam ...@@ -172,7 +172,7 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam
} else if (!strcmp(str, "MVC2")) { } else if (!strcmp(str, "MVC2")) {
st->codec->codec_id = AV_CODEC_ID_MVC2; st->codec->codec_id = AV_CODEC_ID_MVC2;
} else { } else {
av_log_ask_for_sample(avctx, "unknown video compression %s\n", str); avpriv_request_sample(avctx, "video compression %s", str);
} }
av_free(str); av_free(str);
} else if (!strcmp(name, "FPS")) { } else if (!strcmp(name, "FPS")) {
...@@ -214,7 +214,7 @@ static void read_table(AVFormatContext *avctx, AVStream *st, int (*parse)(AVForm ...@@ -214,7 +214,7 @@ static void read_table(AVFormatContext *avctx, AVStream *st, int (*parse)(AVForm
name[sizeof(name) - 1] = 0; name[sizeof(name) - 1] = 0;
size = avio_rb32(pb); size = avio_rb32(pb);
if (parse(avctx, st, name, size) < 0) { if (parse(avctx, st, name, size) < 0) {
av_log_ask_for_sample(avctx, "unknown variable %s\n", name); avpriv_request_sample(avctx, "variable %s", name);
avio_skip(pb, size); avio_skip(pb, size);
} }
} }
...@@ -274,7 +274,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -274,7 +274,7 @@ static int mv_read_header(AVFormatContext *avctx)
vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO; vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
break; break;
default: default:
av_log_ask_for_sample(avctx, "unknown video compression %i\n", v); avpriv_request_sample(avctx, "video compression %i", v);
break; break;
} }
vst->codec->codec_tag = 0; vst->codec->codec_tag = 0;
...@@ -293,7 +293,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -293,7 +293,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (v == AUDIO_FORMAT_SIGNED) { if (v == AUDIO_FORMAT_SIGNED) {
ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE; ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
} else { } else {
av_log_ask_for_sample(avctx, "unknown audio compression (format %i)\n", v); avpriv_request_sample(avctx, "audio compression (format %i)", v);
} }
avio_skip(pb, 12); avio_skip(pb, 12);
...@@ -317,7 +317,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -317,7 +317,7 @@ static int mv_read_header(AVFormatContext *avctx)
read_table(avctx, NULL, parse_global_var); read_table(avctx, NULL, parse_global_var);
if (mv->nb_audio_tracks > 1) { if (mv->nb_audio_tracks > 1) {
av_log_ask_for_sample(avctx, "multiple audio streams\n"); avpriv_request_sample(avctx, "multiple audio streams support");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} else if (mv->nb_audio_tracks) { } else if (mv->nb_audio_tracks) {
ast = avformat_new_stream(avctx, NULL); ast = avformat_new_stream(avctx, NULL);
...@@ -329,7 +329,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -329,7 +329,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (ast->codec->codec_tag == 100 && ast->codec->codec_id == AUDIO_FORMAT_SIGNED && ast->codec->bits_per_coded_sample == 16) { if (ast->codec->codec_tag == 100 && ast->codec->codec_id == AUDIO_FORMAT_SIGNED && ast->codec->bits_per_coded_sample == 16) {
ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE; ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
} else { } else {
av_log_ask_for_sample(avctx, "unknown audio compression %i (format %i, width %i)\n", avpriv_request_sample(avctx, "audio compression %i (format %i, width %i)",
ast->codec->codec_tag, ast->codec->codec_id, ast->codec->bits_per_coded_sample); ast->codec->codec_tag, ast->codec->codec_id, ast->codec->bits_per_coded_sample);
ast->codec->codec_id = AV_CODEC_ID_NONE; ast->codec->codec_id = AV_CODEC_ID_NONE;
} }
...@@ -341,7 +341,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -341,7 +341,7 @@ static int mv_read_header(AVFormatContext *avctx)
} }
if (mv->nb_video_tracks > 1) { if (mv->nb_video_tracks > 1) {
av_log_ask_for_sample(avctx, "multiple video streams\n"); avpriv_request_sample(avctx, "multiple video streams support");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} else if (mv->nb_video_tracks) { } else if (mv->nb_video_tracks) {
vst = avformat_new_stream(avctx, NULL); vst = avformat_new_stream(avctx, NULL);
...@@ -357,7 +357,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -357,7 +357,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (mv->nb_video_tracks) if (mv->nb_video_tracks)
read_index(pb, vst); read_index(pb, vst);
} else { } else {
av_log_ask_for_sample(avctx, "unknown version %i\n", version); avpriv_request_sample(avctx, "version %i", version);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -70,7 +70,7 @@ static int nist_read_header(AVFormatContext *s) ...@@ -70,7 +70,7 @@ static int nist_read_header(AVFormatContext *s)
!av_strcasecmp(coding, "mu-law")) { !av_strcasecmp(coding, "mu-law")) {
st->codec->codec_id = AV_CODEC_ID_PCM_MULAW; st->codec->codec_id = AV_CODEC_ID_PCM_MULAW;
} else { } else {
av_log_ask_for_sample(s, "unsupported coding: %s\n", coding); avpriv_request_sample(s, "coding %s", coding);
} }
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
...@@ -93,7 +93,7 @@ static int nist_read_header(AVFormatContext *s) ...@@ -93,7 +93,7 @@ static int nist_read_header(AVFormatContext *s)
} else if (!av_strcasecmp(format, "10")) { } else if (!av_strcasecmp(format, "10")) {
be = 1; be = 1;
} else if (av_strcasecmp(format, "1")) { } else if (av_strcasecmp(format, "1")) {
av_log_ask_for_sample(s, "unsupported sample byte format: %s\n", format); avpriv_request_sample(s, "sample byte format %s", format);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
} else if (!memcmp(buffer, "sample_coding", 13)) { } else if (!memcmp(buffer, "sample_coding", 13)) {
......
...@@ -195,7 +195,7 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial, int nsegs) ...@@ -195,7 +195,7 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial, int nsegs)
if (i >= ogg->nstreams) if (i >= ogg->nstreams)
return ogg_new_stream(s, serial); return ogg_new_stream(s, serial);
} else if (ogg->nstreams != 1) { } else if (ogg->nstreams != 1) {
av_log_missing_feature(s, "Changing stream parameters in multistream ogg", 0); avpriv_report_missing_feature(s, "Changing stream parameters in multistream ogg");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -139,7 +139,7 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -139,7 +139,7 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
int num_packets; int num_packets;
pmp->audio_packets = avio_r8(pb); pmp->audio_packets = avio_r8(pb);
if (!pmp->audio_packets) { if (!pmp->audio_packets) {
av_log_ask_for_sample(s, "0 audio packets\n"); avpriv_request_sample(s, "0 audio packets");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1; num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
......
...@@ -45,7 +45,7 @@ static int write_header(AVFormatContext *s) ...@@ -45,7 +45,7 @@ static int write_header(AVFormatContext *s)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (codec->extradata_size > 0) { if (codec->extradata_size > 0) {
av_log_missing_feature(s, "remuxing from matroska container", 0); avpriv_report_missing_feature(s, "remuxing from matroska container");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
avpriv_set_pts_info(s->streams[0], 64, 1, codec->sample_rate); avpriv_set_pts_info(s->streams[0], 64, 1, codec->sample_rate);
......
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