]> git.sesse.net Git - ffmpeg/commitdiff
avformat: av_log_ask_for_sample() ---> avpriv_request_sample()
authorDiego Biurrun <diego@biurrun.de>
Mon, 25 Feb 2013 22:54:28 +0000 (23:54 +0100)
committerDiego Biurrun <diego@biurrun.de>
Wed, 13 Mar 2013 19:42:21 +0000 (20:42 +0100)
18 files changed:
libavformat/anm.c
libavformat/au.c
libavformat/bethsoftvid.c
libavformat/filmstripdec.c
libavformat/mov.c
libavformat/mpegts.c
libavformat/mtv.c
libavformat/mxfdec.c
libavformat/omadec.c
libavformat/rsodec.c
libavformat/rtpdec_latm.c
libavformat/rtpdec_qt.c
libavformat/smjpegdec.c
libavformat/spdifdec.c
libavformat/spdifenc.c
libavformat/westwood_aud.c
libavformat/xmv.c
libavformat/xwma.c

index 064b15739f7ac66204b7f0c1595c9767cd370ef3..f78149285b7f0aeb1ecb19f0aec2ec0181d5cc51 100644 (file)
@@ -85,7 +85,7 @@ static int read_header(AVFormatContext *s)
 
     avio_skip(pb, 4); /* magic number */
     if (avio_rl16(pb) != MAX_PAGES) {
-        av_log_ask_for_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES) "\n");
+        avpriv_request_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES));
         return AVERROR_PATCHWELCOME;
     }
 
@@ -163,7 +163,7 @@ static int read_header(AVFormatContext *s)
     return 0;
 
 invalid:
-    av_log_ask_for_sample(s, "Invalid header element encountered.\n");
+    avpriv_request_sample(s, "Invalid header element");
     return AVERROR_PATCHWELCOME;
 }
 
index 4645eb527c4a8252a044fe9ba08e3485c5201ab9..76da6e60920b16cb790eaf300e025133eca098a8 100644 (file)
@@ -85,13 +85,13 @@ static int au_read_header(AVFormatContext *s)
     codec = ff_codec_get_id(codec_au_tags, id);
 
     if (codec == AV_CODEC_ID_NONE) {
-        av_log_ask_for_sample(s, "unknown or unsupported codec tag: %u\n", id);
+        avpriv_request_sample(s, "unknown or unsupported codec tag: %u", id);
         return AVERROR_PATCHWELCOME;
     }
 
     bps = av_get_bits_per_sample(codec);
     if (!bps) {
-        av_log_ask_for_sample(s, "could not determine bits per sample\n");
+        avpriv_request_sample(s, "Unknown bits per sample");
         return AVERROR_PATCHWELCOME;
     }
 
index f41ef52e7895abaa072d375f44cc92fd9ac5122f..120e145a76e5f4f6fe6866bad431a30eee8e8c1b 100644 (file)
@@ -108,8 +108,9 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
             return AVERROR(ENOMEM);
         vid->video_index = st->index;
         if (vid->audio_index < 0) {
-            av_log_ask_for_sample(s, "No audio packet before first video "
-                                  "packet. Using default video time base.\n");
+            avpriv_request_sample(s, "Using default video time base since "
+                                  "having no audio packet before the first "
+                                  "video packet");
         }
         avpriv_set_pts_info(st, 64, 185, vid->sample_rate);
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
index 97cecfa58a51cb0168a0901812d9c64960daf5b2..3fa68424b7ecdd6f3aec09444b2e8b8e18b11745 100644 (file)
@@ -55,7 +55,7 @@ static int read_header(AVFormatContext *s)
 
     st->nb_frames = avio_rb32(pb);
     if (avio_rb16(pb) != 0) {
-        av_log_ask_for_sample(s, "unsupported packing method\n");
+        avpriv_request_sample(s, "Unsupported packing method");
         return AVERROR_PATCHWELCOME;
     }
 
index 45587cd9a3d1ff33983f8edcee5ad77b26df7752..edd6f8eafdcd747929e0fa51dec431f56ded6233 100644 (file)
@@ -718,7 +718,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     version = avio_r8(pb);
     if (version > 1) {
-        av_log_ask_for_sample(c->fc, "unsupported version %d\n", version);
+        avpriv_request_sample(c->fc, "Version %d", version);
         return AVERROR_PATCHWELCOME;
     }
     avio_rb24(pb); /* flags */
index 418833e35bd77886d99ee617bcd8c97b51c57805..2582c5b0bd55043a3a9f304a135b156b0ea6e147 100644 (file)
@@ -1313,7 +1313,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
         }
         if (st->codec->extradata) {
             if (st->codec->extradata_size == 4 && memcmp(st->codec->extradata, *pp, 4))
-                av_log_ask_for_sample(fc, "DVB sub with multiple IDs\n");
+                avpriv_request_sample(fc, "DVB sub with multiple IDs");
         } else {
             st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
             if (st->codec->extradata) {
index 1566faa0863bb1eb36506285dab87146ca343198..3c2ae1f56dc3bdf6b9a48365c89a55a8b2599df9 100644 (file)
@@ -108,7 +108,7 @@ static int mtv_read_header(AVFormatContext *s)
     audio_subsegments = avio_rl16(pb);
 
     if (audio_subsegments == 0) {
-        av_log_ask_for_sample(s, "MTV files without audio are not supported\n");
+        avpriv_request_sample(s, "MTV files without audio");
         return AVERROR_PATCHWELCOME;
     }
 
index 18f7b26fa170cf21e5792777b2e7600a2cf23fbc..7e3a6900103fdec3b8824e6f8117c3d1667a97a4 100644 (file)
@@ -396,8 +396,7 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U
     int item_len = avio_rb32(pb);
 
     if (item_len != 18) {
-        av_log_ask_for_sample(pb, "unsupported primer pack item length %d\n",
-                              item_len);
+        avpriv_request_sample(pb, "Primer pack item length %d", item_len);
         return AVERROR_PATCHWELCOME;
     }
     if (item_num > UINT_MAX / item_len)
@@ -2027,10 +2026,10 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
                 /* if this check is hit then it's possible OPAtom was treated
                  * as OP1a truncate the packet since it's probably very large
                  * (>2 GiB is common) */
-                av_log_ask_for_sample(s,
-                                      "KLV for edit unit %i extends into next "
-                                      "edit unit - OPAtom misinterpreted as "
-                                      "OP1a?\n",
+                avpriv_request_sample(s,
+                                      "OPAtom misinterpreted as OP1a?"
+                                      "KLV for edit unit %i extending into "
+                                      "next edit unit",
                                       mxf->current_edit_unit);
                 klv.length = next_ofs - avio_tell(s->pb);
             }
index 2e565c171615e0f356a54b034fd18f8058de27f2..6d6d311a818df2b65d18e97415293f1554200094 100644 (file)
@@ -306,8 +306,7 @@ static int oma_read_header(AVFormatContext *s)
         case OMA_CODECID_ATRAC3:
             samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100;
             if (samplerate != 44100)
-                av_log_ask_for_sample(s, "Unsupported sample rate: %d\n",
-                                      samplerate);
+                avpriv_request_sample(s, "Sample rate %d", samplerate);
 
             framesize = (codec_params & 0x3FF) * 8;
             jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */
index 2d57a964da49961b7b86ef29687a906b02ce1c50..1e1b7d977dcd101a5f247f04496cd3439a105d51 100644 (file)
@@ -49,7 +49,7 @@ static int rso_read_header(AVFormatContext *s)
 
     bps = av_get_bits_per_sample(codec);
     if (!bps) {
-        av_log_ask_for_sample(s, "could not determine bits per sample\n");
+        avpriv_request_sample(s, "Unknown bits per sample");
         return AVERROR_PATCHWELCOME;
     }
 
index 7d4ae1e44847766d0180279838684491e6c3dec8..050595c77543c129b2d3745a641956660ce85776 100644 (file)
@@ -157,8 +157,8 @@ static int parse_fmtp(AVStream *stream, PayloadContext *data,
     } else if (!strcmp(attr, "cpresent")) {
         int cpresent = atoi(value);
         if (cpresent != 0)
-            av_log_missing_feature(NULL, "RTP MP4A-LATM with in-band "
-                                         "configuration", 1);
+            avpriv_request_sample(NULL,
+                                  "RTP MP4A-LATM with in-band configuration");
     }
 
     return 0;
index 1222b4590d16fadce81deba6591dec88e795e413..af5a5e91f4f98898a061e38bc692a20211b2a7a4 100644 (file)
@@ -97,8 +97,8 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
         is_start  = get_bits1(&gb);
         is_finish = get_bits1(&gb);
         if (!is_start || !is_finish) {
-            av_log_missing_feature(s, "RTP-X-QT with payload description "
-                                      "split over several packets", 1);
+            avpriv_request_sample(s, "RTP-X-QT with payload description "
+                                  "split over several packets");
             return AVERROR_PATCHWELCOME;
         }
         skip_bits(&gb, 12); // reserved
@@ -161,7 +161,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
         avio_seek(&pb, 4, SEEK_SET);
 
     if (has_packet_info) {
-        av_log_missing_feature(s, "RTP-X-QT with packet specific info", 1);
+        avpriv_request_sample(s, "RTP-X-QT with packet-specific info");
         return AVERROR_PATCHWELCOME;
     }
 
@@ -226,7 +226,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
         return 0;
 
     default:  /* unimplemented */
-        av_log_missing_feature(NULL, "RTP-X-QT with packing scheme 2", 1);
+        avpriv_request_sample(NULL, "RTP-X-QT with packing scheme 2");
         return AVERROR_PATCHWELCOME;
     }
 }
index 39bb1b45f5702ebcffee8b4e4e12c957f8404209..623df71d0f7751b081c9a60adb04a7a01a46901e 100644 (file)
@@ -52,7 +52,7 @@ static int smjpeg_read_header(AVFormatContext *s)
     avio_skip(pb, 8); // magic
     version = avio_rb32(pb);
     if (version)
-        av_log_ask_for_sample(s, "unknown version %d\n", version);
+        avpriv_request_sample(s, "Unknown version %d", version);
 
     duration = avio_rb32(pb); // in msec
 
@@ -77,7 +77,7 @@ static int smjpeg_read_header(AVFormatContext *s)
             break;
         case SMJPEG_SND:
             if (ast) {
-                av_log_ask_for_sample(s, "multiple audio streams not supported\n");
+                avpriv_request_sample(s, "Multiple audio streams");
                 return AVERROR_PATCHWELCOME;
             }
             hlength = avio_rb32(pb);
@@ -100,7 +100,7 @@ static int smjpeg_read_header(AVFormatContext *s)
             break;
         case SMJPEG_VID:
             if (vst) {
-                av_log_ask_for_sample(s, "multiple video streams not supported\n");
+                avpriv_request_sample(s, "Multiple video streams");
                 return AVERROR_INVALIDDATA;
             }
             hlength = avio_rb32(pb);
index c8d4a3f430c1800d82e116ddc3fd094345431046..e5202494f51f3ff09709183b11593a35eb34235d 100644 (file)
@@ -91,8 +91,8 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
         break;
     default:
         if (s) { /* be silent during a probe */
-            av_log(s, AV_LOG_WARNING, "Data type 0x%04x", data_type);
-            av_log_missing_feature(s, " in IEC 61937", 1);
+            avpriv_request_sample(s, "Data type 0x%04x in IEC 61937",
+                                  data_type);
         }
         return AVERROR_PATCHWELCOME;
     }
@@ -179,7 +179,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
     pkt_size_bits = avio_rl16(pb);
 
     if (pkt_size_bits % 16)
-        av_log_ask_for_sample(s, "Packet does not end to a 16-bit boundary.");
+        avpriv_request_sample(s, "Packet not ending at a 16-bit boundary");
 
     ret = av_new_packet(pkt, FFALIGN(pkt_size_bits, 16) >> 3);
     if (ret)
index fbc757b797c91a43e744319a6e34b7f0cd2be28e..1f37340a8b441f565c95e801a84afa637183af1f 100644 (file)
@@ -307,7 +307,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt)
          * discs and dts-in-wav. */
         ctx->use_preamble = 0;
     } else if (ctx->out_bytes > ctx->pkt_offset - BURST_HEADER_SIZE) {
-        av_log_ask_for_sample(s, "Unrecognized large DTS frame.");
+        avpriv_request_sample(s, "Unrecognized large DTS frame");
         /* This will fail with a "bitrate too high" in the caller */
     }
 
@@ -412,7 +412,8 @@ static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt)
     if (pkt->size > TRUEHD_FRAME_OFFSET - mat_code_length) {
         /* if such frames exist, we'd need some more complex logic to
          * distribute the TrueHD frames in the MAT frame */
-        av_log_ask_for_sample(s, "TrueHD frame too big, %d bytes\n", pkt->size);
+        avpriv_request_sample(s, "Too large TrueHD frame of %d bytes",
+                              pkt->size);
         return AVERROR_PATCHWELCOME;
     }
 
index 2a06c2952baa17733656c4c334f2a4559182f307..c3f8e6e34da5c7d94229e31c1c00186b348b205e 100644 (file)
@@ -104,7 +104,7 @@ static int wsaud_read_header(AVFormatContext *s)
     switch (codec) {
     case  1:
         if (channels != 1) {
-            av_log_ask_for_sample(s, "Stereo WS-SND1 is not supported.\n");
+            avpriv_request_sample(s, "Stereo WS-SND1");
             return AVERROR_PATCHWELCOME;
         }
         st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1;
@@ -115,7 +115,7 @@ static int wsaud_read_header(AVFormatContext *s)
         st->codec->bit_rate = channels * sample_rate * 4;
         break;
     default:
-        av_log_ask_for_sample(s, "Unknown codec: %d\n", codec);
+        avpriv_request_sample(s, "Unknown codec: %d", codec);
         return AVERROR_PATCHWELCOME;
     }
     avpriv_set_pts_info(st, 64, 1, sample_rate);
index 3f926eff9c04d9a1ab6c668b0774694e8deaebec..d638ad1ef4a26933f466088b6737fe35b7bfd555 100644 (file)
@@ -145,7 +145,7 @@ static int xmv_read_header(AVFormatContext *s)
 
     file_version = avio_rl32(pb);
     if ((file_version != 4) && (file_version != 2))
-        av_log_ask_for_sample(s, "Found uncommon version %d\n", file_version);
+        avpriv_request_sample(s, "Uncommon version %d", file_version);
 
 
     /* Video track */
index 13ce2bb9f967d6267db4dd244c974c481436b9c9..52e423cef7b6e650297df045efc452ed96dc9896 100644 (file)
@@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s)
      * anyway.
      */
     if (st->codec->codec_id != AV_CODEC_ID_WMAV2) {
-        av_log_ask_for_sample(s, "unexpected codec (tag 0x04%x; id %d)\n",
+        avpriv_request_sample(s, "Unexpected codec (tag 0x04%x; id %d)",
                               st->codec->codec_tag, st->codec->codec_id);
     } else {
         /* In all xWMA files I have seen, there is no extradata. But the WMA
@@ -100,7 +100,7 @@ static int xwma_read_header(AVFormatContext *s)
              * if it will work, but just go on and try it, after asking
              * the user for a sample.
              */
-            av_log_ask_for_sample(s, "unexpected extradata (%d bytes)\n",
+            avpriv_request_sample(s, "Unexpected extradata (%d bytes)",
                                   st->codec->extradata_size);
         } else {
             st->codec->extradata_size = 6;