@@ -31,6 +31,9 @@ latency. Must be an integer not lesser than 32. It is 5000000 by default.
Set the maximum number of buffered packets when probing a codec.
Default is 2500 packets.
+@item probe_streams @var{bool} (@emph{input})
+Enable codec auto-detection if set to 1. Default is 1.
+
@item packetsize @var{integer} (@emph{output})
Set packet size.
@@ -1118,7 +1118,7 @@ typedef struct AVStream {
/**
* stream probing state
* -1 -> probing finished
- * 0 -> no probing requested
+ * 0 -> no probing requested or request cancelled by probe_streams being set to 0
* rest -> perform probing with request_probe being the minimum score to accept.
*/
int request_probe;
@@ -1951,6 +1951,13 @@ typedef struct AVFormatContext {
* - decoding: set by user
*/
int max_probe_packets;
+
+ /**
+ * Enable codec auto-detect.
+ * - encoding: unused
+ * - decoding: set by user
+ */
+ int probe_streams;
} AVFormatContext;
#if FF_API_FORMAT_GET_SET
@@ -112,6 +112,7 @@ static const AVOption avformat_options[] = {
{"max_streams", "maximum number of streams", OFFSET(max_streams), AV_OPT_TYPE_INT, { .i64 = 1000 }, 0, INT_MAX, D },
{"skip_estimate_duration_from_pts", "skip duration calculation in estimate_timings_from_pts", OFFSET(skip_estimate_duration_from_pts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D},
{"max_probe_packets", "Maximum number of packets to probe a codec", OFFSET(max_probe_packets), AV_OPT_TYPE_INT, { .i64 = 2500 }, 0, INT_MAX, D },
+{"probe_streams", "codec auto-detection", OFFSET(probe_streams), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, D},
{NULL},
};
@@ -675,6 +675,8 @@ static void force_codec_ids(AVFormatContext *s, AVStream *st)
static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
{
+ if (!s->probe_streams)
+ st->request_probe = 0;
if (st->request_probe>0) {
AVProbeData *pd = &st->probe_data;
int end;
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
-#define LIBAVFORMAT_VERSION_MINOR 59
+#define LIBAVFORMAT_VERSION_MINOR 60
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -69,7 +69,7 @@ typedef struct WAVDemuxContext {
static void set_spdif_s337m(AVFormatContext *s, WAVDemuxContext *wav)
{
AVCodecParameters *par = s->streams[0]->codecpar;
- if ((CONFIG_SPDIF_DEMUXER || CONFIG_S337M_DEMUXER) && par->codec_tag == 1) {
+ if ((CONFIG_SPDIF_DEMUXER || CONFIG_S337M_DEMUXER) && par->codec_tag == 1 && s->probe_streams) {
enum AVCodecID codec;
int len = 1<<16;
int ret = ffio_ensure_seekback(s->pb, len);