* 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>
| ... | ... |
@@ -180,9 +180,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) |
| 180 | 180 |
* @return Returns error status. 0 - OK, !0 - error |
| 181 | 181 |
*/ |
| 182 | 182 |
static av_cold int che_configure(AACContext *ac, |
| 183 |
- enum ChannelPosition che_pos[4][MAX_ELEM_ID], |
|
| 184 |
- int type, int id, |
|
| 185 |
- int *channels) |
|
| 183 |
+ enum ChannelPosition che_pos[4][MAX_ELEM_ID], |
|
| 184 |
+ int type, int id, int *channels) |
|
| 186 | 185 |
{
|
| 187 | 186 |
if (che_pos[type][id]) {
|
| 188 | 187 |
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, |
| 212 | 212 |
* @return Returns error status. 0 - OK, !0 - error |
| 213 | 213 |
*/ |
| 214 | 214 |
static av_cold int output_configure(AACContext *ac, |
| 215 |
- enum ChannelPosition che_pos[4][MAX_ELEM_ID], |
|
| 216 |
- enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], |
|
| 217 |
- int channel_config, enum OCStatus oc_type) |
|
| 215 |
+ enum ChannelPosition che_pos[4][MAX_ELEM_ID], |
|
| 216 |
+ enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], |
|
| 217 |
+ int channel_config, enum OCStatus oc_type) |
|
| 218 | 218 |
{
|
| 219 | 219 |
AVCodecContext *avctx = ac->avctx; |
| 220 | 220 |
int i, type, channels = 0, ret; |
| ... | ... |
@@ -231,7 +230,7 @@ static av_cold int output_configure(AACContext *ac, |
| 231 | 231 |
return ret; |
| 232 | 232 |
} |
| 233 | 233 |
|
| 234 |
- memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); |
|
| 234 |
+ memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); |
|
| 235 | 235 |
|
| 236 | 236 |
avctx->channel_layout = aac_channel_layout[channel_config - 1]; |
| 237 | 237 |
} else {
|
| ... | ... |
@@ -346,8 +345,8 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac, |
| 346 | 346 |
* @return Returns error status. 0 - OK, !0 - error |
| 347 | 347 |
*/ |
| 348 | 348 |
static av_cold int set_default_channel_config(AVCodecContext *avctx, |
| 349 |
- enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], |
|
| 350 |
- int channel_config) |
|
| 349 |
+ enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], |
|
| 350 |
+ int channel_config) |
|
| 351 | 351 |
{
|
| 352 | 352 |
if (channel_config < 1 || channel_config > 7) {
|
| 353 | 353 |
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) |
| 1240 | 1240 |
|
| 1241 | 1241 |
static av_always_inline void predict(PredictorState *ps, float *coef, |
| 1242 | 1242 |
float sf_scale, float inv_sf_scale, |
| 1243 |
- int output_enable) |
|
| 1243 |
+ int output_enable) |
|
| 1244 | 1244 |
{
|
| 1245 | 1245 |
const float a = 0.953125; // 61.0 / 64 |
| 1246 | 1246 |
const float alpha = 0.90625; // 29.0 / 32 |
| ... | ... |
@@ -186,7 +186,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
|
| 186 | 186 |
obuf[i] = c ^ buf[i]; |
| 187 | 187 |
|
| 188 | 188 |
if (off) |
| 189 |
- av_log(NULL,AV_LOG_DEBUG,"Offset of %d not handled, post sample on ffmpeg-dev.\n",off); |
|
| 189 |
+ av_log_ask_for_sample(NULL, "Offset of %d not handled.\n", off); |
|
| 190 | 190 |
|
| 191 | 191 |
return off; |
| 192 | 192 |
} |
| ... | ... |
@@ -4172,7 +4172,7 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample); |
| 4172 | 4172 |
* a pointer to an AVClass struct |
| 4173 | 4173 |
* @param[in] msg string containing an optional message, or NULL if no message |
| 4174 | 4174 |
*/ |
| 4175 |
-void av_log_ask_for_sample(void *avc, const char *msg); |
|
| 4175 |
+void av_log_ask_for_sample(void *avc, const char *msg, ...); |
|
| 4176 | 4176 |
|
| 4177 | 4177 |
/** |
| 4178 | 4178 |
* Register the hardware accelerator hwaccel. |
| ... | ... |
@@ -1268,7 +1268,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) |
| 1268 | 1268 |
/* Try to catch some obviously faulty streams, othervise it might be exploitable */ |
| 1269 | 1269 |
if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512) || (q->samples_per_channel == 1024)) {
|
| 1270 | 1270 |
} else {
|
| 1271 |
- av_log(avctx,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel); |
|
| 1271 |
+ av_log_ask_for_sample(avctx, |
|
| 1272 |
+ "unknown amount of samples_per_channel = %d\n", |
|
| 1273 |
+ q->samples_per_channel); |
|
| 1272 | 1274 |
return -1; |
| 1273 | 1275 |
} |
| 1274 | 1276 |
|
| ... | ... |
@@ -248,7 +248,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
|
| 248 | 248 |
break; |
| 249 | 249 |
default: |
| 250 | 250 |
l->lossy = AV_RL32(avctx->extradata + 8); |
| 251 |
- av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version); |
|
| 251 |
+ av_log_ask_for_sample(avctx, "This is LOCO codec version %i.\n", version); |
|
| 252 | 252 |
} |
| 253 | 253 |
|
| 254 | 254 |
l->mode = AV_RL32(avctx->extradata + 4); |
| ... | ... |
@@ -1208,13 +1208,19 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample) |
| 1208 | 1208 |
av_log(avc, AV_LOG_WARNING, "\n"); |
| 1209 | 1209 |
} |
| 1210 | 1210 |
|
| 1211 |
-void av_log_ask_for_sample(void *avc, const char *msg) |
|
| 1211 |
+void av_log_ask_for_sample(void *avc, const char *msg, ...) |
|
| 1212 | 1212 |
{
|
| 1213 |
+ va_list argument_list; |
|
| 1214 |
+ |
|
| 1215 |
+ va_start(argument_list, msg); |
|
| 1216 |
+ |
|
| 1213 | 1217 |
if (msg) |
| 1214 |
- av_log(avc, AV_LOG_WARNING, "%s ", msg); |
|
| 1218 |
+ av_vlog(avc, AV_LOG_WARNING, msg, argument_list); |
|
| 1215 | 1219 |
av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample " |
| 1216 | 1220 |
"of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ " |
| 1217 | 1221 |
"and contact the ffmpeg-devel mailing list.\n"); |
| 1222 |
+ |
|
| 1223 |
+ va_end(argument_list); |
|
| 1218 | 1224 |
} |
| 1219 | 1225 |
|
| 1220 | 1226 |
static AVHWAccel *first_hwaccel = NULL; |
| ... | ... |
@@ -464,8 +464,6 @@ static void vqa_decode_chunk(VqaContext *s) |
| 464 | 464 |
switch (s->vqa_version) {
|
| 465 | 465 |
|
| 466 | 466 |
case 1: |
| 467 |
-/* still need sample media for this case (only one game, "Legend of |
|
| 468 |
- * Kyrandia III : Malcolm's Revenge", is known to use this version) */ |
|
| 469 | 467 |
lobyte = s->decode_buffer[lobytes * 2]; |
| 470 | 468 |
hibyte = s->decode_buffer[(lobytes * 2) + 1]; |
| 471 | 469 |
vector_index = ((hibyte << 8) | lobyte) >> 3; |
| ... | ... |
@@ -96,11 +96,13 @@ static int decode_frame(AVCodecContext *avctx, |
| 96 | 96 |
else {
|
| 97 | 97 |
l->shift = 8 - (buf[2] >> 4); |
| 98 | 98 |
if (l->shift > 4) {
|
| 99 |
- av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4); |
|
| 99 |
+ av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n", |
|
| 100 |
+ buf[2] >> 4); |
|
| 100 | 101 |
l->shift = 4; |
| 101 | 102 |
} |
| 102 | 103 |
if (l->shift < 1) {
|
| 103 |
- av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4); |
|
| 104 |
+ av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n", |
|
| 105 |
+ buf[2] >> 4); |
|
| 104 | 106 |
l->shift = 1; |
| 105 | 107 |
} |
| 106 | 108 |
} |
| ... | ... |
@@ -107,7 +107,8 @@ static int oma_read_header(AVFormatContext *s, |
| 107 | 107 |
case OMA_CODECID_ATRAC3: |
| 108 | 108 |
samplerate = srate_tab[(codec_params >> 13) & 7]*100; |
| 109 | 109 |
if (samplerate != 44100) |
| 110 |
- av_log(s, AV_LOG_ERROR, "Unsupported sample rate, send sample file to developers: %d\n", samplerate); |
|
| 110 |
+ av_log_ask_for_sample(s, "Unsupported sample rate: %d\n", |
|
| 111 |
+ samplerate); |
|
| 111 | 112 |
|
| 112 | 113 |
framesize = (codec_params & 0x3FF) * 8; |
| 113 | 114 |
jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */ |