[FFmpeg-devel] [PATCH]Bump probesize and analyzeduration to 64bit (again)
Carl Eugen Hoyos
cehoyos at ag.or.at
Sat Sep 12 20:04:34 CEST 2015
Hi!
Attached patch implements making probesize and analyzeduration 64bit
unless api compatibility was requested.
I will add a line to doc/APIchanges and do a minor version bump.
Please review, this cannot wait, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b7f18c1..26c2464 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1391,7 +1391,7 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate.
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
/**
* @deprecated deprecated in favor of probesize2
*/
@@ -1755,7 +1755,7 @@ typedef struct AVFormatContext {
* via AVOptions (NO direct access).
* Can be set to 0 to let avformat choose using a heuristic.
*/
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int64_t max_analyze_duration2;
#else
int64_t max_analyze_duration;
@@ -1767,7 +1767,7 @@ typedef struct AVFormatContext {
* Demuxing only, set by the caller before avformat_open_input()
* via AVOptions (NO direct access).
*/
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int64_t probesize2;
#else
int64_t probesize;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index ed0a86b..c35cc9d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2513,7 +2513,7 @@ static int mpegts_read_header(AVFormatContext *s)
uint8_t buf[8 * 1024] = {0};
int len;
int64_t pos, probesize =
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
s->probesize ? s->probesize : s->probesize2;
#else
s->probesize;
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 773814a..6e66c27 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -36,7 +36,7 @@
static const AVOption avformat_options[] = {
{"avioflags", NULL, OFFSET(avio_flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "avioflags"},
{"direct", "reduce buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVIO_FLAG_DIRECT }, INT_MIN, INT_MAX, D|E, "avioflags"},
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
{"probesize", "set probing size", OFFSET(probesize2), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
#else
{"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
@@ -58,7 +58,7 @@ static const AVOption avformat_options[] = {
{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
{"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, D},
{"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration2), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D},
#else
{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D},
diff --git a/libavformat/utils.c b/libavformat/utils.c
index db988c0..e5729a7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3085,14 +3085,14 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
// new streams might appear, no options for those
int orig_nb_streams = ic->nb_streams;
int flush_codecs;
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int64_t max_analyze_duration = ic->max_analyze_duration2;
#else
int64_t max_analyze_duration = ic->max_analyze_duration;
#endif
int64_t max_stream_analyze_duration;
int64_t max_subtitle_analyze_duration;
-#if FF_API_PROBESIZE_32
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int64_t probesize = ic->probesize2;
#else
int64_t probesize = ic->probesize;
diff --git a/libavformat/version.h b/libavformat/version.h
index 18be8b2..1e26f9c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -65,9 +65,6 @@
#ifndef FF_API_URL_FEOF
#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
-#ifndef FF_API_PROBESIZE_32
-#define FF_API_PROBESIZE_32 (LIBAVFORMAT_VERSION_MAJOR < 58)
-#endif
#ifndef FF_API_R_FRAME_RATE
#define FF_API_R_FRAME_RATE 1
More information about the ffmpeg-devel
mailing list