Commit 1ecdf891 authored by Diego Biurrun's avatar Diego Biurrun

avformat: av_log_ask_for_sample() ---> avpriv_request_sample()

parent 63d744e2
...@@ -85,7 +85,7 @@ static int read_header(AVFormatContext *s) ...@@ -85,7 +85,7 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 4); /* magic number */ avio_skip(pb, 4); /* magic number */
if (avio_rl16(pb) != MAX_PAGES) { 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; return AVERROR_PATCHWELCOME;
} }
...@@ -163,7 +163,7 @@ static int read_header(AVFormatContext *s) ...@@ -163,7 +163,7 @@ static int read_header(AVFormatContext *s)
return 0; return 0;
invalid: invalid:
av_log_ask_for_sample(s, "Invalid header element encountered.\n"); avpriv_request_sample(s, "Invalid header element");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
......
...@@ -85,13 +85,13 @@ static int au_read_header(AVFormatContext *s) ...@@ -85,13 +85,13 @@ static int au_read_header(AVFormatContext *s)
codec = ff_codec_get_id(codec_au_tags, id); codec = ff_codec_get_id(codec_au_tags, id);
if (codec == AV_CODEC_ID_NONE) { 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; return AVERROR_PATCHWELCOME;
} }
bps = av_get_bits_per_sample(codec); bps = av_get_bits_per_sample(codec);
if (!bps) { 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; return AVERROR_PATCHWELCOME;
} }
......
...@@ -108,8 +108,9 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, ...@@ -108,8 +108,9 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
vid->video_index = st->index; vid->video_index = st->index;
if (vid->audio_index < 0) { if (vid->audio_index < 0) {
av_log_ask_for_sample(s, "No audio packet before first video " avpriv_request_sample(s, "Using default video time base since "
"packet. Using default video time base.\n"); "having no audio packet before the first "
"video packet");
} }
avpriv_set_pts_info(st, 64, 185, vid->sample_rate); avpriv_set_pts_info(st, 64, 185, vid->sample_rate);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......
...@@ -55,7 +55,7 @@ static int read_header(AVFormatContext *s) ...@@ -55,7 +55,7 @@ static int read_header(AVFormatContext *s)
st->nb_frames = avio_rb32(pb); st->nb_frames = avio_rb32(pb);
if (avio_rb16(pb) != 0) { 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; return AVERROR_PATCHWELCOME;
} }
......
...@@ -718,7 +718,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -718,7 +718,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
version = avio_r8(pb); version = avio_r8(pb);
if (version > 1) { 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; return AVERROR_PATCHWELCOME;
} }
avio_rb24(pb); /* flags */ avio_rb24(pb); /* flags */
......
...@@ -1313,7 +1313,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type ...@@ -1313,7 +1313,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
} }
if (st->codec->extradata) { if (st->codec->extradata) {
if (st->codec->extradata_size == 4 && memcmp(st->codec->extradata, *pp, 4)) 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 { } else {
st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE); st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
if (st->codec->extradata) { if (st->codec->extradata) {
......
...@@ -108,7 +108,7 @@ static int mtv_read_header(AVFormatContext *s) ...@@ -108,7 +108,7 @@ static int mtv_read_header(AVFormatContext *s)
audio_subsegments = avio_rl16(pb); audio_subsegments = avio_rl16(pb);
if (audio_subsegments == 0) { 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; return AVERROR_PATCHWELCOME;
} }
......
...@@ -396,8 +396,7 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U ...@@ -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); int item_len = avio_rb32(pb);
if (item_len != 18) { if (item_len != 18) {
av_log_ask_for_sample(pb, "unsupported primer pack item length %d\n", avpriv_request_sample(pb, "Primer pack item length %d", item_len);
item_len);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
if (item_num > UINT_MAX / item_len) if (item_num > UINT_MAX / item_len)
...@@ -2027,10 +2026,10 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) ...@@ -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 /* if this check is hit then it's possible OPAtom was treated
* as OP1a truncate the packet since it's probably very large * as OP1a truncate the packet since it's probably very large
* (>2 GiB is common) */ * (>2 GiB is common) */
av_log_ask_for_sample(s, avpriv_request_sample(s,
"KLV for edit unit %i extends into next " "OPAtom misinterpreted as OP1a?"
"edit unit - OPAtom misinterpreted as " "KLV for edit unit %i extending into "
"OP1a?\n", "next edit unit",
mxf->current_edit_unit); mxf->current_edit_unit);
klv.length = next_ofs - avio_tell(s->pb); klv.length = next_ofs - avio_tell(s->pb);
} }
......
...@@ -306,8 +306,7 @@ static int oma_read_header(AVFormatContext *s) ...@@ -306,8 +306,7 @@ static int oma_read_header(AVFormatContext *s)
case OMA_CODECID_ATRAC3: case OMA_CODECID_ATRAC3:
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100; samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100;
if (samplerate != 44100) if (samplerate != 44100)
av_log_ask_for_sample(s, "Unsupported sample rate: %d\n", avpriv_request_sample(s, "Sample rate %d", samplerate);
samplerate);
framesize = (codec_params & 0x3FF) * 8; framesize = (codec_params & 0x3FF) * 8;
jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */ jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */
......
...@@ -49,7 +49,7 @@ static int rso_read_header(AVFormatContext *s) ...@@ -49,7 +49,7 @@ static int rso_read_header(AVFormatContext *s)
bps = av_get_bits_per_sample(codec); bps = av_get_bits_per_sample(codec);
if (!bps) { 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; return AVERROR_PATCHWELCOME;
} }
......
...@@ -157,8 +157,8 @@ static int parse_fmtp(AVStream *stream, PayloadContext *data, ...@@ -157,8 +157,8 @@ static int parse_fmtp(AVStream *stream, PayloadContext *data,
} else if (!strcmp(attr, "cpresent")) { } else if (!strcmp(attr, "cpresent")) {
int cpresent = atoi(value); int cpresent = atoi(value);
if (cpresent != 0) if (cpresent != 0)
av_log_missing_feature(NULL, "RTP MP4A-LATM with in-band " avpriv_request_sample(NULL,
"configuration", 1); "RTP MP4A-LATM with in-band configuration");
} }
return 0; return 0;
......
...@@ -97,8 +97,8 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -97,8 +97,8 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
is_start = get_bits1(&gb); is_start = get_bits1(&gb);
is_finish = get_bits1(&gb); is_finish = get_bits1(&gb);
if (!is_start || !is_finish) { if (!is_start || !is_finish) {
av_log_missing_feature(s, "RTP-X-QT with payload description " avpriv_request_sample(s, "RTP-X-QT with payload description "
"split over several packets", 1); "split over several packets");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
skip_bits(&gb, 12); // reserved skip_bits(&gb, 12); // reserved
...@@ -161,7 +161,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -161,7 +161,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
avio_seek(&pb, 4, SEEK_SET); avio_seek(&pb, 4, SEEK_SET);
if (has_packet_info) { 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; return AVERROR_PATCHWELCOME;
} }
...@@ -226,7 +226,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -226,7 +226,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
return 0; return 0;
default: /* unimplemented */ 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; return AVERROR_PATCHWELCOME;
} }
} }
......
...@@ -52,7 +52,7 @@ static int smjpeg_read_header(AVFormatContext *s) ...@@ -52,7 +52,7 @@ static int smjpeg_read_header(AVFormatContext *s)
avio_skip(pb, 8); // magic avio_skip(pb, 8); // magic
version = avio_rb32(pb); version = avio_rb32(pb);
if (version) 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 duration = avio_rb32(pb); // in msec
...@@ -77,7 +77,7 @@ static int smjpeg_read_header(AVFormatContext *s) ...@@ -77,7 +77,7 @@ static int smjpeg_read_header(AVFormatContext *s)
break; break;
case SMJPEG_SND: case SMJPEG_SND:
if (ast) { if (ast) {
av_log_ask_for_sample(s, "multiple audio streams not supported\n"); avpriv_request_sample(s, "Multiple audio streams");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
hlength = avio_rb32(pb); hlength = avio_rb32(pb);
...@@ -100,7 +100,7 @@ static int smjpeg_read_header(AVFormatContext *s) ...@@ -100,7 +100,7 @@ static int smjpeg_read_header(AVFormatContext *s)
break; break;
case SMJPEG_VID: case SMJPEG_VID:
if (vst) { if (vst) {
av_log_ask_for_sample(s, "multiple video streams not supported\n"); avpriv_request_sample(s, "Multiple video streams");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
hlength = avio_rb32(pb); hlength = avio_rb32(pb);
......
...@@ -91,8 +91,8 @@ static int spdif_get_offset_and_codec(AVFormatContext *s, ...@@ -91,8 +91,8 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
break; break;
default: default:
if (s) { /* be silent during a probe */ if (s) { /* be silent during a probe */
av_log(s, AV_LOG_WARNING, "Data type 0x%04x", data_type); avpriv_request_sample(s, "Data type 0x%04x in IEC 61937",
av_log_missing_feature(s, " in IEC 61937", 1); data_type);
} }
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
...@@ -179,7 +179,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -179,7 +179,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt_size_bits = avio_rl16(pb); pkt_size_bits = avio_rl16(pb);
if (pkt_size_bits % 16) 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); ret = av_new_packet(pkt, FFALIGN(pkt_size_bits, 16) >> 3);
if (ret) if (ret)
......
...@@ -307,7 +307,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt) ...@@ -307,7 +307,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt)
* discs and dts-in-wav. */ * discs and dts-in-wav. */
ctx->use_preamble = 0; ctx->use_preamble = 0;
} else if (ctx->out_bytes > ctx->pkt_offset - BURST_HEADER_SIZE) { } 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 */ /* This will fail with a "bitrate too high" in the caller */
} }
...@@ -412,7 +412,8 @@ static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt) ...@@ -412,7 +412,8 @@ static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt)
if (pkt->size > TRUEHD_FRAME_OFFSET - mat_code_length) { if (pkt->size > TRUEHD_FRAME_OFFSET - mat_code_length) {
/* if such frames exist, we'd need some more complex logic to /* if such frames exist, we'd need some more complex logic to
* distribute the TrueHD frames in the MAT frame */ * 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; return AVERROR_PATCHWELCOME;
} }
......
...@@ -104,7 +104,7 @@ static int wsaud_read_header(AVFormatContext *s) ...@@ -104,7 +104,7 @@ static int wsaud_read_header(AVFormatContext *s)
switch (codec) { switch (codec) {
case 1: case 1:
if (channels != 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; return AVERROR_PATCHWELCOME;
} }
st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1; st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1;
...@@ -115,7 +115,7 @@ static int wsaud_read_header(AVFormatContext *s) ...@@ -115,7 +115,7 @@ static int wsaud_read_header(AVFormatContext *s)
st->codec->bit_rate = channels * sample_rate * 4; st->codec->bit_rate = channels * sample_rate * 4;
break; break;
default: default:
av_log_ask_for_sample(s, "Unknown codec: %d\n", codec); avpriv_request_sample(s, "Unknown codec: %d", codec);
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
avpriv_set_pts_info(st, 64, 1, sample_rate); avpriv_set_pts_info(st, 64, 1, sample_rate);
......
...@@ -145,7 +145,7 @@ static int xmv_read_header(AVFormatContext *s) ...@@ -145,7 +145,7 @@ static int xmv_read_header(AVFormatContext *s)
file_version = avio_rl32(pb); file_version = avio_rl32(pb);
if ((file_version != 4) && (file_version != 2)) 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 */ /* Video track */
......
...@@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s) ...@@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s)
* anyway. * anyway.
*/ */
if (st->codec->codec_id != AV_CODEC_ID_WMAV2) { 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); st->codec->codec_tag, st->codec->codec_id);
} else { } else {
/* In all xWMA files I have seen, there is no extradata. But the WMA /* 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) ...@@ -100,7 +100,7 @@ static int xwma_read_header(AVFormatContext *s)
* if it will work, but just go on and try it, after asking * if it will work, but just go on and try it, after asking
* the user for a sample. * 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); st->codec->extradata_size);
} else { } else {
st->codec->extradata_size = 6; st->codec->extradata_size = 6;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment