diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-02-15 17:27:32 +0000 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-02-21 16:01:31 +0100 |
commit | ca085e667b998b7ceff276290f34fd4188438787 (patch) | |
tree | 67f20739d4e4516211cb02b5a37157233099b926 /libavcodec/mlpdec.c | |
parent | 33510e86b1bcf66c83ceea9eddba597dd3e71506 (diff) | |
download | ffmpeg-ca085e667b998b7ceff276290f34fd4188438787.tar.gz |
mlpdec: use av_log_ask_for_sample()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r-- | libavcodec/mlpdec.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 9a2496dcb5..91efaf36ab 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -38,12 +38,6 @@ /** number of bits used for VLC lookup - longest Huffman code is 9 */ #define VLC_BITS 9 - -static const char* sample_message = - "Please file a bug report following the instructions at " - "http://libav.org/bugreports.html and include " - "a sample of this file."; - typedef struct SubStream { /// Set if a valid restart header has been read. Otherwise the substream cannot be decoded. uint8_t restart_seen; @@ -305,10 +299,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) return AVERROR_INVALIDDATA; } if (mh.num_substreams > MAX_SUBSTREAMS) { - av_log(m->avctx, AV_LOG_ERROR, + av_log_ask_for_sample(m->avctx, "Number of substreams %d is larger than the maximum supported " - "by the decoder. %s\n", mh.num_substreams, sample_message); - return AVERROR_INVALIDDATA; + "by the decoder.\n", mh.num_substreams); + return AVERROR_PATCHWELCOME; } m->access_unit_size = mh.access_unit_size; @@ -387,10 +381,10 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, /* This should happen for TrueHD streams with >6 channels and MLP's noise * type. It is not yet known if this is allowed. */ if (s->max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) { - av_log(m->avctx, AV_LOG_ERROR, + av_log_ask_for_sample(m->avctx, "Number of channels %d is larger than the maximum supported " - "by the decoder. %s\n", s->max_channel+2, sample_message); - return AVERROR_INVALIDDATA; + "by the decoder.\n", s->max_channel + 2); + return AVERROR_PATCHWELCOME; } if (s->min_channel > s->max_channel) { @@ -432,10 +426,10 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, for (ch = 0; ch <= s->max_matrix_channel; ch++) { int ch_assign = get_bits(gbp, 6); if (ch_assign > s->max_matrix_channel) { - av_log(m->avctx, AV_LOG_ERROR, - "Assignment of matrix channel %d to invalid output channel %d. %s\n", - ch, ch_assign, sample_message); - return AVERROR_INVALIDDATA; + av_log_ask_for_sample(m->avctx, + "Assignment of matrix channel %d to invalid output channel %d.\n", + ch, ch_assign); + return AVERROR_PATCHWELCOME; } s->ch_assign[ch_assign] = ch; } @@ -763,8 +757,8 @@ static int read_block_data(MLPDecodeContext *m, GetBitContext *gbp, if (s->data_check_present) { expected_stream_pos = get_bits_count(gbp); expected_stream_pos += get_bits(gbp, 16); - av_log(m->avctx, AV_LOG_WARNING, "This file contains some features " - "we have not tested yet. %s\n", sample_message); + av_log_ask_for_sample(m->avctx, "This file contains some features " + "we have not tested yet.\n"); } if (s->blockpos + s->blocksize > m->access_unit_size) { |