diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-04-22 12:24:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-22 22:27:05 +0200 |
commit | 748d4816d92c735f662c7ac299e79ff0f6fe252e (patch) | |
tree | 2431ce310f2b9ed6741e3605afccb6203a333776 /libavformat | |
parent | d02d04a18f300ebe97319ca6e91fc943cb14f58b (diff) | |
download | ffmpeg-748d4816d92c735f662c7ac299e79ff0f6fe252e.tar.gz |
avformat: add AVFMT_FLAG_FASTSEEK, use it for mp3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 1 | ||||
-rw-r--r-- | libavformat/mp3dec.c | 2 | ||||
-rw-r--r-- | libavformat/options_table.h | 1 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index c2f798d649..339ff52912 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1391,6 +1391,7 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) #define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) #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 /** * @deprecated deprecated in favor of probesize2 diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index a2d3dfe737..8c177764b3 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -337,7 +337,7 @@ static int mp3_read_header(AVFormatContext *s) int i; if (mp3->usetoc < 0) - mp3->usetoc = 2; + mp3->usetoc = (s->flags & AVFMT_FLAG_FAST_SEEK) ? 0 : 2; st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/options_table.h b/libavformat/options_table.h index 40f1e0ae43..58670b0035 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -49,6 +49,7 @@ static const AVOption avformat_options[] = { {"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"}, {"sortdts", "try to interleave outputted packets by dts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, "fflags"}, {"keepside", "don't merge side data", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"}, +{"fastseek", "fast but inaccurate seeks", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FAST_SEEK }, INT_MIN, INT_MAX, D, "fflags"}, {"latm", "enable RTP MP4A-LATM payload", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"}, {"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}, diff --git a/libavformat/version.h b/libavformat/version.h index 55287aed38..381c0718b6 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 56 -#define LIBAVFORMAT_VERSION_MINOR 30 +#define LIBAVFORMAT_VERSION_MINOR 31 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |