Merge remote branch 'qatar/master'

* qatar/master:
  Use av_log_ask_for_sample() to request samples from users.
  Make av_log_ask_for_sample() accept a variable number of arguments.
  vqavideo: We no longer need to ask for version 1 samples.
  aacdec: indentation cosmetics

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-04-23 01:09:43 +02:00
commit e16665bf72
9 changed files with 29 additions and 21 deletions

View File

@ -180,9 +180,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
* @return Returns error status. 0 - OK, !0 - error
*/
static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
int type, int id,
int *channels)
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
int type, int id, int *channels)
{
if (che_pos[type][id]) {
if (!ac->che[type][id] && !(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
@ -212,9 +211,9 @@ static av_cold int che_configure(AACContext *ac,
* @return Returns error status. 0 - OK, !0 - error
*/
static av_cold int output_configure(AACContext *ac,
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
int channel_config, enum OCStatus oc_type)
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
int channel_config, enum OCStatus oc_type)
{
AVCodecContext *avctx = ac->avctx;
int i, type, channels = 0, ret;
@ -231,7 +230,7 @@ static av_cold int output_configure(AACContext *ac,
return ret;
}
memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
avctx->channel_layout = aac_channel_layout[channel_config - 1];
} else {
@ -346,8 +345,8 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
* @return Returns error status. 0 - OK, !0 - error
*/
static av_cold int set_default_channel_config(AVCodecContext *avctx,
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
int channel_config)
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
int channel_config)
{
if (channel_config < 1 || channel_config > 7) {
av_log(avctx, AV_LOG_ERROR, "invalid default channel configuration (%d)\n",
@ -1240,7 +1239,7 @@ static av_always_inline float flt16_trunc(float pf)
static av_always_inline void predict(PredictorState *ps, float *coef,
float sf_scale, float inv_sf_scale,
int output_enable)
int output_enable)
{
const float a = 0.953125; // 61.0 / 64
const float alpha = 0.90625; // 29.0 / 32

View File

@ -186,7 +186,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
obuf[i] = c ^ buf[i];
if (off)
av_log(NULL,AV_LOG_DEBUG,"Offset of %d not handled, post sample on ffmpeg-dev.\n",off);
av_log_ask_for_sample(NULL, "Offset of %d not handled.\n", off);
return off;
}

View File

@ -4172,7 +4172,7 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample);
* a pointer to an AVClass struct
* @param[in] msg string containing an optional message, or NULL if no message
*/
void av_log_ask_for_sample(void *avc, const char *msg);
void av_log_ask_for_sample(void *avc, const char *msg, ...);
/**
* Register the hardware accelerator hwaccel.

View File

@ -1268,7 +1268,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512) || (q->samples_per_channel == 1024)) {
} else {
av_log(avctx,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel);
av_log_ask_for_sample(avctx,
"unknown amount of samples_per_channel = %d\n",
q->samples_per_channel);
return -1;
}

View File

@ -248,7 +248,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
break;
default:
l->lossy = AV_RL32(avctx->extradata + 8);
av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version);
av_log_ask_for_sample(avctx, "This is LOCO codec version %i.\n", version);
}
l->mode = AV_RL32(avctx->extradata + 4);

View File

@ -1208,13 +1208,19 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample)
av_log(avc, AV_LOG_WARNING, "\n");
}
void av_log_ask_for_sample(void *avc, const char *msg)
void av_log_ask_for_sample(void *avc, const char *msg, ...)
{
va_list argument_list;
va_start(argument_list, msg);
if (msg)
av_log(avc, AV_LOG_WARNING, "%s ", msg);
av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
"of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ "
"and contact the ffmpeg-devel mailing list.\n");
va_end(argument_list);
}
static AVHWAccel *first_hwaccel = NULL;

View File

@ -464,8 +464,6 @@ static void vqa_decode_chunk(VqaContext *s)
switch (s->vqa_version) {
case 1:
/* still need sample media for this case (only one game, "Legend of
* Kyrandia III : Malcolm's Revenge", is known to use this version) */
lobyte = s->decode_buffer[lobytes * 2];
hibyte = s->decode_buffer[(lobytes * 2) + 1];
vector_index = ((hibyte << 8) | lobyte) >> 3;

View File

@ -96,11 +96,13 @@ static int decode_frame(AVCodecContext *avctx,
else {
l->shift = 8 - (buf[2] >> 4);
if (l->shift > 4) {
av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4);
av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n",
buf[2] >> 4);
l->shift = 4;
}
if (l->shift < 1) {
av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4);
av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n",
buf[2] >> 4);
l->shift = 1;
}
}

View File

@ -107,7 +107,8 @@ static int oma_read_header(AVFormatContext *s,
case OMA_CODECID_ATRAC3:
samplerate = srate_tab[(codec_params >> 13) & 7]*100;
if (samplerate != 44100)
av_log(s, AV_LOG_ERROR, "Unsupported sample rate, send sample file to developers: %d\n", samplerate);
av_log_ask_for_sample(s, "Unsupported sample rate: %d\n",
samplerate);
framesize = (codec_params & 0x3FF) * 8;
jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */