Browse code

avcodec: av_log_ask_for_sample() ---> avpriv_request_sample()

Diego Biurrun authored on 2013/03/14 05:17:05
Showing 36 changed files
... ...
@@ -1115,10 +1115,10 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
1115 1115
                     offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
1116 1116
                     clipped_offset = av_clip(offset[2], -155, 100);
1117 1117
                     if (offset[2] != clipped_offset) {
1118
-                        av_log_ask_for_sample(ac->avctx, "Intensity stereo "
1119
-                                "position clipped (%d -> %d).\nIf you heard an "
1120
-                                "audible artifact, there may be a bug in the "
1121
-                                "decoder. ", offset[2], clipped_offset);
1118
+                        avpriv_request_sample(ac->avctx,
1119
+                                              "If you heard an audible artifact, there may be a bug in the decoder. "
1120
+                                              "Clipped intensity stereo position (%d -> %d)",
1121
+                                              offset[2], clipped_offset);
1122 1122
                     }
1123 1123
                     sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
1124 1124
                 }
... ...
@@ -1130,10 +1130,10 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
1130 1130
                         offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
1131 1131
                     clipped_offset = av_clip(offset[1], -100, 155);
1132 1132
                     if (offset[1] != clipped_offset) {
1133
-                        av_log_ask_for_sample(ac->avctx, "Noise gain clipped "
1134
-                                "(%d -> %d).\nIf you heard an audible "
1135
-                                "artifact, there may be a bug in the decoder. ",
1136
-                                offset[1], clipped_offset);
1133
+                        avpriv_request_sample(ac->avctx,
1134
+                                              "If you heard an audible artifact, there may be a bug in the decoder. "
1135
+                                              "Clipped noise gain (%d -> %d)",
1136
+                                              offset[1], clipped_offset);
1137 1137
                     }
1138 1138
                     sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
1139 1139
                 }
... ...
@@ -53,7 +53,7 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
53 53
 
54 54
     /* check for encoding=3 block_size=18, sample_size=4 */
55 55
     if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) {
56
-        av_log_ask_for_sample(avctx, "unsupported ADX format\n");
56
+        avpriv_request_sample(avctx, "Support for this ADX format");
57 57
         return AVERROR_PATCHWELCOME;
58 58
     }
59 59
 
... ...
@@ -535,8 +535,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
535 535
     case 24:
536 536
     case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
537 537
              break;
538
-    default: av_log_ask_for_sample(avctx, "Sample depth %d is not supported.\n",
539
-                                   alac->sample_size);
538
+    default: avpriv_request_sample(avctx, "Sample depth %d", alac->sample_size);
540 539
              return AVERROR_PATCHWELCOME;
541 540
     }
542 541
     avctx->bits_per_raw_sample = alac->sample_size;
... ...
@@ -127,11 +127,11 @@ static int decode_frame(AVCodecContext *avctx,
127 127
     bytestream2_init(&s->gb, avpkt->data, buf_size);
128 128
 
129 129
     if (bytestream2_get_byte(&s->gb) != 0x42) {
130
-        av_log_ask_for_sample(avctx, "unknown record type\n");
130
+        avpriv_request_sample(avctx, "Unknown record type");
131 131
         return buf_size;
132 132
     }
133 133
     if (bytestream2_get_byte(&s->gb)) {
134
-        av_log_ask_for_sample(avctx, "padding bytes not supported\n");
134
+        avpriv_request_sample(avctx, "Padding bytes");
135 135
         return buf_size;
136 136
     }
137 137
     bytestream2_skip(&s->gb, 2);
... ...
@@ -161,7 +161,7 @@ static int decode_frame(AVCodecContext *avctx,
161 161
                 if (type == 0)
162 162
                     break; // stop
163 163
                 if (type == 2) {
164
-                    av_log_ask_for_sample(avctx, "unknown opcode");
164
+                    avpriv_request_sample(avctx, "Unknown opcode");
165 165
                     return AVERROR_PATCHWELCOME;
166 166
                 }
167 167
                 continue;
... ...
@@ -222,7 +222,7 @@ static int execute_code(AVCodecContext * avctx, int c)
222 222
             height = 60<<4;
223 223
             break;
224 224
         default:
225
-            av_log_ask_for_sample(avctx, "unsupported screen mode\n");
225
+            avpriv_request_sample(avctx, "Unsupported screen mode");
226 226
         }
227 227
         if (width != avctx->width || height != avctx->height) {
228 228
             av_frame_unref(s->frame);
... ...
@@ -291,7 +291,7 @@ static int execute_code(AVCodecContext * avctx, int c)
291 291
             } else if (m == 49) {
292 292
                 s->fg = ansi_to_cga[DEFAULT_BG_COLOR];
293 293
             } else {
294
-                av_log_ask_for_sample(avctx, "unsupported rendition parameter\n");
294
+                avpriv_request_sample(avctx, "Unsupported rendition parameter");
295 295
             }
296 296
         }
297 297
         break;
... ...
@@ -308,7 +308,7 @@ static int execute_code(AVCodecContext * avctx, int c)
308 308
         s->y = av_clip(s->sy, 0, avctx->height - s->font_height);
309 309
         break;
310 310
     default:
311
-        av_log_ask_for_sample(avctx, "unsupported escape code\n");
311
+        avpriv_request_sample(avctx, "Unknown escape code");
312 312
         break;
313 313
     }
314 314
     return 0;
... ...
@@ -205,8 +205,8 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
205 205
         avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
206 206
         break;
207 207
     default:
208
-        av_log_ask_for_sample(avctx, "Unsupported bits per coded sample %d\n",
209
-                              s->bps);
208
+        avpriv_request_sample(avctx,
209
+                              "%d bits per coded sample", s->bps);
210 210
         return AVERROR_PATCHWELCOME;
211 211
     }
212 212
     s->avctx             = avctx;
... ...
@@ -169,7 +169,7 @@ static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)
169 169
         output[i] = c ^ buf[i];
170 170
 
171 171
     if (off)
172
-        av_log_ask_for_sample(NULL, "Offset of %d not handled.\n", off);
172
+        avpriv_request_sample(NULL, "Offset of %d", off);
173 173
 
174 174
     return off;
175 175
 }
... ...
@@ -233,7 +233,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
233 233
     if (c->bpp < 1)
234 234
         return AVERROR_INVALIDDATA;
235 235
     if (c->format != BIT_PLANAR && c->format != BIT_LINE) {
236
-        av_log_ask_for_sample(avctx, "unsupported pixel format: 0x%0x\n", c->format);
236
+        avpriv_request_sample(avctx, "Pixel format 0x%0x", c->format);
237 237
         return AVERROR_PATCHWELCOME;
238 238
     }
239 239
 
... ...
@@ -253,7 +253,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
253 253
             return AVERROR_INVALIDDATA;
254 254
         avctx->pix_fmt = AV_PIX_FMT_BGR24;
255 255
     } else {
256
-        av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n",
256
+        avpriv_request_sample(avctx, "Encoding %d and bpp %d",
257 257
                               encoding, c->bpp);
258 258
         return AVERROR_PATCHWELCOME;
259 259
     }
... ...
@@ -334,7 +334,7 @@ static int cinepak_decode (CinepakContext *s)
334 334
     /* if this is the first frame, check for deviant Sega FILM data */
335 335
     if (s->sega_film_skip_bytes == -1) {
336 336
         if (!encoded_buf_size) {
337
-            av_log_ask_for_sample(s->avctx, "encoded_buf_size is 0");
337
+            avpriv_request_sample(s->avctx, "encoded_buf_size 0");
338 338
             return AVERROR_PATCHWELCOME;
339 339
         }
340 340
         if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) {
... ...
@@ -1100,7 +1100,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1100 1100
         switch (q->subpacket[s].cookversion) {
1101 1101
         case MONO:
1102 1102
             if (avctx->channels != 1) {
1103
-                av_log_ask_for_sample(avctx, "Container channels != 1.\n");
1103
+                avpriv_request_sample(avctx, "Container channels != 1");
1104 1104
                 return AVERROR_PATCHWELCOME;
1105 1105
             }
1106 1106
             av_log(avctx, AV_LOG_DEBUG, "MONO\n");
... ...
@@ -1114,7 +1114,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1114 1114
             break;
1115 1115
         case JOINT_STEREO:
1116 1116
             if (avctx->channels != 2) {
1117
-                av_log_ask_for_sample(avctx, "Container channels != 2.\n");
1117
+                avpriv_request_sample(avctx, "Container channels != 2");
1118 1118
                 return AVERROR_PATCHWELCOME;
1119 1119
             }
1120 1120
             av_log(avctx, AV_LOG_DEBUG, "JOINT_STEREO\n");
... ...
@@ -1154,7 +1154,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1154 1154
 
1155 1155
             break;
1156 1156
         default:
1157
-            av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
1157
+            avpriv_request_sample(avctx, "Cook version %d",
1158
+                                  q->subpacket[s].cookversion);
1158 1159
             return AVERROR_PATCHWELCOME;
1159 1160
         }
1160 1161
 
... ...
@@ -1170,7 +1171,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1170 1170
 
1171 1171
         /* Try to catch some obviously faulty streams, othervise it might be exploitable */
1172 1172
         if (q->subpacket[s].total_subbands > 53) {
1173
-            av_log_ask_for_sample(avctx, "total_subbands > 53\n");
1173
+            avpriv_request_sample(avctx, "total_subbands > 53");
1174 1174
             return AVERROR_PATCHWELCOME;
1175 1175
         }
1176 1176
 
... ...
@@ -1182,7 +1183,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1182 1182
         }
1183 1183
 
1184 1184
         if (q->subpacket[s].subbands > 50) {
1185
-            av_log_ask_for_sample(avctx, "subbands > 50\n");
1185
+            avpriv_request_sample(avctx, "subbands > 50");
1186 1186
             return AVERROR_PATCHWELCOME;
1187 1187
         }
1188 1188
         q->subpacket[s].gains1.now      = q->subpacket[s].gain_1;
... ...
@@ -1193,7 +1194,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1193 1193
         q->num_subpackets++;
1194 1194
         s++;
1195 1195
         if (s > MAX_SUBPACKETS) {
1196
-            av_log_ask_for_sample(avctx, "Too many subpackets > 5\n");
1196
+            avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS);
1197 1197
             return AVERROR_PATCHWELCOME;
1198 1198
         }
1199 1199
     }
... ...
@@ -1235,8 +1236,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1235 1235
     /* Try to catch some obviously faulty streams, othervise it might be exploitable */
1236 1236
     if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
1237 1237
         q->samples_per_channel != 1024) {
1238
-        av_log_ask_for_sample(avctx,
1239
-                              "unknown amount of samples_per_channel = %d\n",
1238
+        avpriv_request_sample(avctx, "samples_per_channel = %d",
1240 1239
                               q->samples_per_channel);
1241 1240
         return AVERROR_PATCHWELCOME;
1242 1241
     }
... ...
@@ -1598,14 +1598,15 @@ static void dca_exss_parse_header(DCAContext *s)
1598 1598
 
1599 1599
         num_audiop = get_bits(&s->gb, 3) + 1;
1600 1600
         if (num_audiop > 1) {
1601
-            av_log_ask_for_sample(s->avctx, "Multiple DTS-HD audio presentations.");
1601
+            avpriv_request_sample(s->avctx,
1602
+                                  "Multiple DTS-HD audio presentations");
1602 1603
             /* ignore such streams for now */
1603 1604
             return;
1604 1605
         }
1605 1606
 
1606 1607
         num_assets = get_bits(&s->gb, 3) + 1;
1607 1608
         if (num_assets > 1) {
1608
-            av_log_ask_for_sample(s->avctx, "Multiple DTS-HD audio assets.");
1609
+            avpriv_request_sample(s->avctx, "Multiple DTS-HD audio assets");
1609 1610
             /* ignore such streams for now */
1610 1611
             return;
1611 1612
         }
... ...
@@ -53,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
53 53
     pic->key_frame = 1;
54 54
 
55 55
     if (AV_RL32(src) != 0x01000002) {
56
-        av_log_ask_for_sample(avctx, "Unknown frame header %X\n", AV_RL32(src));
56
+        avpriv_request_sample(avctx, "Frame header %X", AV_RL32(src));
57 57
         return AVERROR_PATCHWELCOME;
58 58
     }
59 59
     src += 16;
... ...
@@ -3356,8 +3356,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
3356 3356
                         h->droppable         = last_pic_droppable;
3357 3357
                         return AVERROR_INVALIDDATA;
3358 3358
                     } else if (last_pic_droppable != h->droppable) {
3359
-                        av_log_ask_for_sample(h->avctx,
3360
-                                              "Found reference and non-reference fields in the same frame.\n");
3359
+                        avpriv_request_sample(h->avctx,
3360
+                                              "Found reference and non-reference fields in the same frame, which");
3361 3361
                         h->picture_structure = last_pic_structure;
3362 3362
                         h->droppable         = last_pic_droppable;
3363 3363
                         return AVERROR_PATCHWELCOME;
... ...
@@ -181,7 +181,7 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
181 181
         avctx->channels = 1;
182 182
 
183 183
     if (avctx->channels > 2) {
184
-        av_log_ask_for_sample(avctx, "Number of channels is not supported\n");
184
+        avpriv_request_sample(avctx, "Number of channels > 2");
185 185
         return AVERROR_PATCHWELCOME;
186 186
     }
187 187
 
... ...
@@ -778,8 +778,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
778 778
     stream_format_code = get_bits(&q->gb, 3);
779 779
 
780 780
     if (stream_format_code & 1) {
781
-        av_log_ask_for_sample(avctx, "Stream format %X is not supported\n",
782
-                              stream_format_code);
781
+        avpriv_request_sample(avctx, "Stream format %X", stream_format_code);
783 782
         return AVERROR_PATCHWELCOME;
784 783
     }
785 784
 
... ...
@@ -960,12 +960,12 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
960 960
     }
961 961
 
962 962
     if (ctx->frame_flags & BS_8BIT_PEL) {
963
-        av_log_ask_for_sample(avctx, "8-bit pixel format\n");
963
+        avpriv_request_sample(avctx, "8-bit pixel format");
964 964
         return AVERROR_PATCHWELCOME;
965 965
     }
966 966
 
967 967
     if (ctx->frame_flags & BS_MV_X_HALF || ctx->frame_flags & BS_MV_Y_HALF) {
968
-        av_log_ask_for_sample(avctx, "halfpel motion vectors\n");
968
+        avpriv_request_sample(avctx, "Halfpel motion vectors");
969 969
         return AVERROR_PATCHWELCOME;
970 970
     }
971 971
 
... ...
@@ -329,12 +329,12 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
329 329
             transform_id = get_bits(&ctx->gb, 5);
330 330
             if (transform_id >= FF_ARRAY_ELEMS(transforms) ||
331 331
                 !transforms[transform_id].inv_trans) {
332
-                av_log_ask_for_sample(avctx, "Unimplemented transform: %d!\n", transform_id);
332
+                avpriv_request_sample(avctx, "Transform %d", transform_id);
333 333
                 return AVERROR_PATCHWELCOME;
334 334
             }
335 335
             if ((transform_id >= 7 && transform_id <= 9) ||
336 336
                  transform_id == 17) {
337
-                av_log_ask_for_sample(avctx, "DCT transform not supported yet!\n");
337
+                avpriv_request_sample(avctx, "DCT transform");
338 338
                 return AVERROR_PATCHWELCOME;
339 339
             }
340 340
 
... ...
@@ -283,7 +283,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
283 283
         break;
284 284
     default:
285 285
         l->lossy = AV_RL32(avctx->extradata + 8);
286
-        av_log_ask_for_sample(avctx, "This is LOCO codec version %i.\n", version);
286
+        avpriv_request_sample(avctx, "LOCO codec version %i", version);
287 287
     }
288 288
 
289 289
     l->mode = AV_RL32(avctx->extradata + 4);
... ...
@@ -329,9 +329,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
329 329
         return AVERROR_INVALIDDATA;
330 330
     }
331 331
     if (mh.num_substreams > MAX_SUBSTREAMS) {
332
-        av_log_ask_for_sample(m->avctx,
333
-               "Number of substreams %d is larger than the maximum supported "
334
-               "by the decoder.\n", mh.num_substreams);
332
+        avpriv_request_sample(m->avctx,
333
+                              "%d substreams (more than the "
334
+                              "maximum supported by the decoder)",
335
+                              mh.num_substreams);
335 336
         return AVERROR_PATCHWELCOME;
336 337
     }
337 338
 
... ...
@@ -429,9 +430,10 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
429 429
     /* This should happen for TrueHD streams with >6 channels and MLP's noise
430 430
      * type. It is not yet known if this is allowed. */
431 431
     if (s->max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) {
432
-        av_log_ask_for_sample(m->avctx,
433
-               "Number of channels %d is larger than the maximum supported "
434
-               "by the decoder.\n", s->max_channel + 2);
432
+        avpriv_request_sample(m->avctx,
433
+                              "%d channels (more than the "
434
+                              "maximum supported by the decoder)",
435
+                              s->max_channel + 2);
435 436
         return AVERROR_PATCHWELCOME;
436 437
     }
437 438
 
... ...
@@ -490,9 +492,9 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
490 490
                                                             channel);
491 491
         }
492 492
         if (ch_assign > s->max_matrix_channel) {
493
-            av_log_ask_for_sample(m->avctx,
494
-                   "Assignment of matrix channel %d to invalid output channel %d.\n",
495
-                   ch, ch_assign);
493
+            avpriv_request_sample(m->avctx,
494
+                                  "Assignment of matrix channel %d to invalid output channel %d",
495
+                                  ch, ch_assign);
496 496
             return AVERROR_PATCHWELCOME;
497 497
         }
498 498
         s->ch_assign[ch_assign] = ch;
... ...
@@ -823,8 +825,8 @@ static int read_block_data(MLPDecodeContext *m, GetBitContext *gbp,
823 823
     if (s->data_check_present) {
824 824
         expected_stream_pos  = get_bits_count(gbp);
825 825
         expected_stream_pos += get_bits(gbp, 16);
826
-        av_log_ask_for_sample(m->avctx, "This file contains some features "
827
-                              "we have not tested yet.\n");
826
+        avpriv_request_sample(m->avctx,
827
+                              "Substreams with VLC block size check info");
828 828
     }
829 829
 
830 830
     if (s->blockpos + s->blocksize > m->access_unit_size) {
... ...
@@ -65,8 +65,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
65 65
 
66 66
     /* Musepack SV7 is always stereo */
67 67
     if (avctx->channels != 2) {
68
-        av_log_ask_for_sample(avctx, "Unsupported number of channels: %d\n",
69
-                              avctx->channels);
68
+        avpriv_request_sample(avctx, "%d channels", avctx->channels);
70 69
         return AVERROR_PATCHWELCOME;
71 70
     }
72 71
 
... ...
@@ -430,8 +430,8 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
430 430
         ctx->dsp.upsample_plane(f->data[1], f->linesize[1], w >> 1, h >> 1);
431 431
         ctx->dsp.upsample_plane(f->data[2], f->linesize[2], w >> 1, h >> 1);
432 432
     } else if (v->respic)
433
-        av_log_ask_for_sample(v->s.avctx,
434
-                              "Asymmetric WMV9 rectangle subsampling\n");
433
+        avpriv_request_sample(v->s.avctx,
434
+                              "Asymmetric WMV9 rectangle subsampling");
435 435
 
436 436
     av_assert0(f->linesize[1] == f->linesize[2]);
437 437
 
... ...
@@ -123,7 +123,7 @@ static int decode_frame(AVCodecContext *avctx,
123 123
     s->nb_planes   = (tmp >> 4) + 1;
124 124
     bpp            = bits_per_plane * s->nb_planes;
125 125
     if (bits_per_plane > 8 || bpp < 1 || bpp > 32) {
126
-        av_log_ask_for_sample(s, "unsupported bit depth\n");
126
+        avpriv_request_sample(s, "Unsupported bit depth");
127 127
         return AVERROR_PATCHWELCOME;
128 128
     }
129 129
 
... ...
@@ -233,7 +233,7 @@ static int decode_frame(AVCodecContext *avctx,
233 233
             }
234 234
         }
235 235
     } else {
236
-        av_log_ask_for_sample(s, "uncompressed image\n");
236
+        avpriv_request_sample(s, "Uncompressed image");
237 237
         return avpkt->size;
238 238
     }
239 239
 
... ...
@@ -42,7 +42,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
42 42
     bytes_per_pixel = AV_RL16(buf+12) >> 3;
43 43
 
44 44
     if (bytes_per_pixel != 2) {
45
-        av_log_ask_for_sample(avctx, "Image format is not RGB15.\n");
45
+        avpriv_request_sample(avctx, "Image format not RGB15");
46 46
         return AVERROR_PATCHWELCOME;
47 47
     }
48 48
 
... ...
@@ -51,7 +51,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
51 51
     if (buf_end - buf < offset)
52 52
         return AVERROR_INVALIDDATA;
53 53
     if (offset != 0x2c)
54
-        av_log_ask_for_sample(avctx, "offset != 0x2c\n");
54
+        avpriv_request_sample(avctx, "offset != 0x2c");
55 55
 
56 56
     buf += offset;
57 57
 
... ...
@@ -635,8 +635,8 @@ static qcelp_packet_rate determine_bitrate(AVCodecContext *avctx,
635 635
         return I_F_Q;
636 636
 
637 637
     if (bitrate == SILENCE) {
638
-        //FIXME: Remove experimental warning when tested with samples.
639
-        av_log_ask_for_sample(avctx, "'Blank frame handling is experimental.");
638
+        // FIXME: Remove this warning when tested with samples.
639
+        avpriv_request_sample(avctx, "Blank frame handling");
640 640
     }
641 641
     return bitrate;
642 642
 }
... ...
@@ -136,7 +136,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
136 136
 
137 137
     ctx->version = AV_RB16(avctx->extradata + 4);
138 138
     if (ctx->version != 0x103) {
139
-        av_log_ask_for_sample(avctx, "unknown version %X\n", ctx->version);
139
+        avpriv_request_sample(avctx, "Unknown version %X", ctx->version);
140 140
         return AVERROR_PATCHWELCOME;
141 141
     }
142 142
 
... ...
@@ -54,7 +54,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
54 54
     buf      += 32;
55 55
 
56 56
     if (type == RT_FORMAT_TIFF || type == RT_FORMAT_IFF || type == RT_EXPERIMENTAL) {
57
-        av_log_ask_for_sample(avctx, "unsupported (compression) type\n");
57
+        avpriv_request_sample(avctx, "TIFF/IFF/EXPERIMENTAL (compression) type");
58 58
         return AVERROR_PATCHWELCOME;
59 59
     }
60 60
     if (type > RT_FORMAT_IFF) {
... ...
@@ -66,7 +66,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
66 66
         return AVERROR_INVALIDDATA;
67 67
     }
68 68
     if (maptype == RMT_RAW) {
69
-        av_log_ask_for_sample(avctx, "unsupported colormap type\n");
69
+        avpriv_request_sample(avctx, "Unknown colormap type");
70 70
         return AVERROR_PATCHWELCOME;
71 71
     }
72 72
     if (maptype > RMT_RAW) {
... ...
@@ -355,7 +355,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
355 355
         s->flags = FLAG_KEYFRAME;
356 356
 
357 357
     if (s->flags & FLAG_SPRITE) {
358
-        av_log_ask_for_sample(s->avctx, "SPRITE frame found.\n");
358
+        avpriv_request_sample(s->avctx, "Frame with sprite");
359 359
         /* FIXME header.width, height, xoffset and yoffset aren't initialized */
360 360
         return AVERROR_PATCHWELCOME;
361 361
     } else {
... ...
@@ -365,7 +365,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
365 365
             if ((s->w < 213) && (s->h >= 176))
366 366
             {
367 367
                 s->flags |= FLAG_INTERPOLATED;
368
-                av_log_ask_for_sample(s->avctx, "INTERPOLATION selected.\n");
368
+                avpriv_request_sample(s->avctx, "Interpolated frame");
369 369
             }
370 370
         }
371 371
     }
... ...
@@ -63,7 +63,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
63 63
     TSContext *c = avctx->priv_data;
64 64
 
65 65
     if (avctx->channels != 1) {
66
-        av_log_ask_for_sample(avctx, "Unsupported channel count: %d\n", avctx->channels);
66
+        avpriv_request_sample(avctx, "Channel count %d", avctx->channels);
67 67
         return AVERROR_PATCHWELCOME;
68 68
     }
69 69
 
... ...
@@ -376,7 +376,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
376 376
     c->frame_pred = (c->frame_info >> 8) & 3;
377 377
 
378 378
     if (c->frame_pred == PRED_GRADIENT) {
379
-        av_log_ask_for_sample(avctx, "Frame uses gradient prediction\n");
379
+        avpriv_request_sample(avctx, "Frame with gradient prediction");
380 380
         return AVERROR_PATCHWELCOME;
381 381
     }
382 382
 
... ...
@@ -491,7 +491,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
491 491
     c->flags           = AV_RL32(avctx->extradata + 12);
492 492
 
493 493
     if (c->frame_info_size != 4)
494
-        av_log_ask_for_sample(avctx, "Frame info is not 4 bytes\n");
494
+        avpriv_request_sample(avctx, "Frame info not 4 bytes");
495 495
     av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08X\n", c->flags);
496 496
     c->slices      = (c->flags >> 24) + 1;
497 497
     c->compression = c->flags & 1;
... ...
@@ -52,7 +52,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
52 52
     }
53 53
 
54 54
     if (avpkt->size > avctx->width * avctx->height * 8 / 3) {
55
-        av_log_ask_for_sample(avctx, "Probably padded data\n");
55
+        avpriv_request_sample(avctx, "(Probably) padded data");
56 56
     }
57 57
 
58 58
     if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
... ...
@@ -4850,7 +4850,7 @@ static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
4850 4850
     for (sprite = 0; sprite <= v->two_sprites; sprite++) {
4851 4851
         vc1_sprite_parse_transform(gb, sd->coefs[sprite]);
4852 4852
         if (sd->coefs[sprite][1] || sd->coefs[sprite][3])
4853
-            av_log_ask_for_sample(avctx, "Rotation coefficients are not zero");
4853
+            avpriv_request_sample(avctx, "Non-zero rotation coefficients");
4854 4854
         av_log(avctx, AV_LOG_DEBUG, sprite ? "S2:" : "S1:");
4855 4855
         for (i = 0; i < 7; i++)
4856 4856
             av_log(avctx, AV_LOG_DEBUG, " %d.%.3d",
... ...
@@ -141,8 +141,9 @@ static int parse_setup_header(AVCodecContext *avctx, VorbisParseContext *s,
141 141
      * we may need to approach this the long way and parse the whole Setup
142 142
      * header, but I hope very much that it never comes to that. */
143 143
     if (last_mode_count > 2) {
144
-        av_log_ask_for_sample(avctx, "%d modes found. This is either a false "
145
-                              "positive or a sample from an unknown encoder.\n",
144
+        avpriv_request_sample(avctx,
145
+                              "%d modes (either a false positive or a "
146
+                              "sample from an unknown encoder)",
146 147
                               last_mode_count);
147 148
     }
148 149
     /* We're limiting the mode count to 63 so that we know that the previous
... ...
@@ -202,7 +202,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
202 202
         av_dlog(avctx, "\n");
203 203
 
204 204
     } else {
205
-        av_log_ask_for_sample(avctx, "Unsupported extradata size\n");
205
+        avpriv_request_sample(avctx, "Unsupported extradata size");
206 206
         return AVERROR_PATCHWELCOME;
207 207
     }
208 208
 
... ...
@@ -256,7 +256,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
256 256
                s->num_channels);
257 257
         return AVERROR_INVALIDDATA;
258 258
     } else if (s->num_channels > WMALL_MAX_CHANNELS) {
259
-        av_log_ask_for_sample(avctx, "unsupported number of channels\n");
259
+        avpriv_request_sample(avctx,
260
+                              "More than %d channels", WMALL_MAX_CHANNELS);
260 261
         return AVERROR_PATCHWELCOME;
261 262
     }
262 263
 
... ...
@@ -925,8 +926,8 @@ static int decode_subframe(WmallDecodeCtx *s)
925 925
             s->do_lpc = get_bits1(&s->gb);
926 926
             if (s->do_lpc) {
927 927
                 decode_lpc(s);
928
-                av_log_ask_for_sample(s->avctx, "Inverse LPC filter not "
929
-                                      "implemented. Expect wrong output.\n");
928
+                avpriv_request_sample(s->avctx, "Expect wrong output since "
929
+                                      "inverse LPC filter");
930 930
             }
931 931
         } else
932 932
             s->do_lpc = 0;
... ...
@@ -1137,7 +1138,7 @@ static void save_bits(WmallDecodeCtx *s, GetBitContext* gb, int len,
1137 1137
     buflen = (s->num_saved_bits + len + 8) >> 3;
1138 1138
 
1139 1139
     if (len <= 0 || buflen > MAX_FRAMESIZE) {
1140
-        av_log_ask_for_sample(s->avctx, "input buffer too small\n");
1140
+        avpriv_request_sample(s->avctx, "Too small input buffer");
1141 1141
         s->packet_loss = 1;
1142 1142
         return;
1143 1143
     }
... ...
@@ -299,7 +299,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
299 299
         av_dlog(avctx, "\n");
300 300
 
301 301
     } else {
302
-        av_log_ask_for_sample(avctx, "Unknown extradata size\n");
302
+        avpriv_request_sample(avctx, "Unknown extradata size");
303 303
         return AVERROR_PATCHWELCOME;
304 304
     }
305 305
 
... ...
@@ -346,7 +346,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
346 346
                avctx->channels);
347 347
         return AVERROR_INVALIDDATA;
348 348
     } else if (avctx->channels > WMAPRO_MAX_CHANNELS) {
349
-        av_log_ask_for_sample(avctx, "unsupported number of channels\n");
349
+        avpriv_request_sample(avctx,
350
+                              "More than %d channels", WMAPRO_MAX_CHANNELS);
350 351
         return AVERROR_PATCHWELCOME;
351 352
     }
352 353
 
... ...
@@ -676,8 +677,8 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
676 676
         int remaining_channels = s->channels_for_cur_subframe;
677 677
 
678 678
         if (get_bits1(&s->gb)) {
679
-            av_log_ask_for_sample(s->avctx,
680
-                                  "unsupported channel transform bit\n");
679
+            avpriv_request_sample(s->avctx,
680
+                                  "Channel transform bit");
681 681
             return AVERROR_PATCHWELCOME;
682 682
         }
683 683
 
... ...
@@ -713,8 +714,8 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
713 713
             if (chgroup->num_channels == 2) {
714 714
                 if (get_bits1(&s->gb)) {
715 715
                     if (get_bits1(&s->gb)) {
716
-                        av_log_ask_for_sample(s->avctx,
717
-                                              "unsupported channel transform type\n");
716
+                        avpriv_request_sample(s->avctx,
717
+                                              "Unknown channel transform type");
718 718
                     }
719 719
                 } else {
720 720
                     chgroup->transform = 1;
... ...
@@ -739,8 +740,8 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
739 739
                     } else {
740 740
                         /** FIXME: more than 6 coupled channels not supported */
741 741
                         if (chgroup->num_channels > 6) {
742
-                            av_log_ask_for_sample(s->avctx,
743
-                                                  "coupled channels > 6\n");
742
+                            avpriv_request_sample(s->avctx,
743
+                                                  "Coupled channels > 6");
744 744
                         } else {
745 745
                             memcpy(chgroup->decorrelation_matrix,
746 746
                                    default_decorrelation[chgroup->num_channels],
... ...
@@ -1147,7 +1148,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
1147 1147
 
1148 1148
     /** no idea for what the following bit is used */
1149 1149
     if (get_bits1(&s->gb)) {
1150
-        av_log_ask_for_sample(s->avctx, "reserved bit set\n");
1150
+        avpriv_request_sample(s->avctx, "Reserved bit");
1151 1151
         return AVERROR_PATCHWELCOME;
1152 1152
     }
1153 1153
 
... ...
@@ -1453,7 +1454,7 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
1453 1453
     buflen = (s->num_saved_bits + len + 8) >> 3;
1454 1454
 
1455 1455
     if (len <= 0 || buflen > MAX_FRAMESIZE) {
1456
-        av_log_ask_for_sample(s->avctx, "input buffer too small\n");
1456
+        avpriv_request_sample(s->avctx, "Too small input buffer");
1457 1457
         s->packet_loss = 1;
1458 1458
         return;
1459 1459
     }
... ...
@@ -92,12 +92,14 @@ static int decode_frame(AVCodecContext *avctx,
92 92
     else {
93 93
         l->shift = 8 - (buf[2] >> 4);
94 94
         if (l->shift > 4) {
95
-            av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n",
95
+            avpriv_request_sample(avctx,
96
+                                  "Unknown WNV1 frame header value %i",
96 97
                                   buf[2] >> 4);
97 98
             l->shift = 4;
98 99
         }
99 100
         if (l->shift < 1) {
100
-            av_log_ask_for_sample(avctx, "Unknown WNV1 frame header value %i\n",
101
+            avpriv_request_sample(avctx,
102
+                                  "Unknown WNV1 frame header value %i",
101 103
                                   buf[2] >> 4);
102 104
             l->shift = 1;
103 105
         }
... ...
@@ -92,7 +92,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
92 92
     }
93 93
 
94 94
     if (xoffset) {
95
-        av_log_ask_for_sample(avctx, "unsupported xoffset %d\n", xoffset);
95
+        avpriv_request_sample(avctx, "xoffset %d", xoffset);
96 96
         return AVERROR_PATCHWELCOME;
97 97
     }
98 98
 
... ...
@@ -192,7 +192,9 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
192 192
     }
193 193
 
194 194
     if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
195
-        av_log_ask_for_sample(avctx, "unknown file: bpp %d, pixdepth %d, vclass %d\n", bpp, pixdepth, vclass);
195
+        avpriv_request_sample(avctx,
196
+                              "Unknown file: bpp %d, pixdepth %d, vclass %d",
197
+                              bpp, pixdepth, vclass);
196 198
         return AVERROR_PATCHWELCOME;
197 199
     }
198 200
 
... ...
@@ -432,18 +432,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
432 432
                "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",
433 433
                c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
434 434
         if (hi_ver != 0 || lo_ver != 1) {
435
-            av_log_ask_for_sample(avctx, "Unsupported version %i.%i\n",
436
-                                  hi_ver, lo_ver);
435
+            avpriv_request_sample(avctx, "Version %i.%i", hi_ver, lo_ver);
437 436
             return AVERROR_PATCHWELCOME;
438 437
         }
439 438
         if (c->bw == 0 || c->bh == 0) {
440
-            av_log_ask_for_sample(avctx, "Unsupported block size %ix%i\n",
441
-                                  c->bw, c->bh);
439
+            avpriv_request_sample(avctx, "Block size %ix%i", c->bw, c->bh);
442 440
             return AVERROR_PATCHWELCOME;
443 441
         }
444 442
         if (c->comp != 0 && c->comp != 1) {
445
-            av_log_ask_for_sample(avctx, "Unsupported compression type %i\n",
446
-                                  c->comp);
443
+            avpriv_request_sample(avctx, "Compression type %i", c->comp);
447 444
             return AVERROR_PATCHWELCOME;
448 445
         }
449 446
 
... ...
@@ -474,8 +471,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
474 474
         default:
475 475
             c->decode_intra = NULL;
476 476
             c->decode_xor = NULL;
477
-            av_log_ask_for_sample(avctx, "Unsupported (for now) format %i\n",
478
-                                  c->fmt);
477
+            avpriv_request_sample(avctx, "Format %i", c->fmt);
479 478
             return AVERROR_PATCHWELCOME;
480 479
         }
481 480