[FFmpeg-cvslog] doc/encoders: Remove text about single bit-depth libx264 support
ffmpeg | branch: master | Tobias Rapp | Mon Mar 15 14:07:27 2021 +0100| [b60fe9508f5cf2adec82b0411c313c5638f33cc5] | committer: Tobias Rapp doc/encoders: Remove text about single bit-depth libx264 support In the meanwhile libx264 allows to be configured for including both 8/10 bit support within a single library. The new libx264 interface was enabled in 2f96190732d15510ba29471fa45d66841c0c3df1. Signed-off-by: Tobias Rapp > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b60fe9508f5cf2adec82b0411c313c5638f33cc5 --- doc/encoders.texi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index c9c8785afb..a92eb0eb2f 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2305,9 +2305,7 @@ pixel formats as input instead of YUV. @subsection Supported Pixel Formats x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at -x264's configure time. FFmpeg only supports one bit depth in one particular -build. In other words, it is not possible to build one FFmpeg with multiple -versions of x264 with different bit depths. +x264's configure time. @subsection Options ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 18:35:56 2021 +0100| [7d09579190def3ef7562399489e628f3b65714ce] | committer: Anton Khirnov lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS This cap is currently used to mark multithreading-capable codecs that wrap external libraries with their own multithreading code. The name is highly confusing for our API users, since libavcodec ALWAYS handles thread_count=0 (see commit message in previous commit). Therefore rename the cap and update its documentation to make its meaning clear. The old name is kept deprecated until next+1 major bump. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d09579190def3ef7562399489e628f3b65714ce --- doc/APIchanges | 5 + fftools/cmdutils.c | 6 +++--- libavcodec/codec.h | 9 +++-- libavcodec/libaomdec.c | 2 +- libavcodec/libaomenc.c | 2 +- libavcodec/libdav1d.c | 2 +- libavcodec/libdavs2.c | 2 +- libavcodec/libkvazaar.c | 2 +- libavcodec/libopenh264enc.c | 2 +- libavcodec/librav1e.c | 2 +- libavcodec/libsvtav1.c | 2 +- libavcodec/libuavs3d.c | 2 +- libavcodec/libvpxdec.c | 4 ++-- libavcodec/libvpxenc.c | 4 ++-- libavcodec/libx264.c| 6 +++--- libavcodec/libx265.c| 2 +- libavcodec/libxavs.c| 2 +- libavcodec/libxavs2.c | 2 +- libavcodec/version.h| 5 - 19 files changed, 38 insertions(+), 25 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index c0d955b1fa..bed34df861 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,11 @@ libavutil: 2017-10-21 API changes, most recent first: +2021-03-xx - xx - lavc 58.132.100 - codec.h + Add AV_CODEC_CAP_OTHER_THREADS as a new name for + AV_CODEC_CAP_AUTO_THREADS. AV_CODEC_CAP_AUTO_THREADS + is now deprecated. + 2021-03-12 - xx - lavc 58.131.100 - avcodec.h codec.h Add a get_encode_buffer callback to AVCodecContext, similar to get_buffer2 but for encoders. diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 8cfca22564..5e2d3c174b 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -1415,7 +1415,7 @@ static void print_codec(const AVCodec *c) printf("variable "); if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | - AV_CODEC_CAP_AUTO_THREADS)) + AV_CODEC_CAP_OTHER_THREADS)) printf("threads "); if (c->capabilities & AV_CODEC_CAP_AVOID_PROBING) printf("avoidprobe "); @@ -1432,12 +1432,12 @@ static void print_codec(const AVCodec *c) printf("Threading capabilities: "); switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | - AV_CODEC_CAP_AUTO_THREADS)) { + AV_CODEC_CAP_OTHER_THREADS)) { case AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break; case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break; case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break; -case AV_CODEC_CAP_AUTO_THREADS : printf("auto");break; +case AV_CODEC_CAP_OTHER_THREADS: printf("other"); break; default: printf("none");break; } printf("\n"); diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 1bb70260ac..50a22f6e3c 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -115,9 +115,14 @@ */ #define AV_CODEC_CAP_PARAM_CHANGE(1 << 14) /** - * Codec supports avctx->thread_count == 0 (auto). + * Codec supports multithreading through a method other than slice- or + * frame-level multithreading. Typically this marks wrappers around + * multithreading-capable external libraries. */ -#define AV_CODEC_CAP_AUTO_THREADS(1 << 15) +#define AV_CODEC_CAP_OTHER_THREADS (1 << 15) +#if FF_API_AUTO_THREADS +#define AV_CODEC_CAP_AUTO_THREADSAV_CODEC_CAP_OTHER_THREADS +#endif /** * Audio encoder supports receiving a different number of samples in each call. */ diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 327a5e18fb..1fc0a0001d 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -236,7 +236,7 @@ AVCodec ff_libaom_av1_decoder = { .init = av1_init, .close = aom_free, .decode = aom_decode, -.capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .wrapper_name = "libaom", diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index f99fdc0b73..2c3c3eb185 100644 --- a/libavcod
[FFmpeg-cvslog] lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal cap
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 18:00:44 2021 +0100| [8a129077cc37202a00dd666bd5365c3f61ea2e80] | committer: Anton Khirnov lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal cap AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark codecs that spawn threads internally and are able to select an optimal threads count by themselves (all such codecs are wrappers around external libraries). It is used by lavc generic code to check whether it should handle thread_count=0 itself or pass the zero directly to the codec implementation. Within this meaning, it is clearly supposed to be an internal cap rather than a public one, since from the viewpoint of a libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens in the generic code or within the codec internals is not a meaningful difference for the caller. External aspects of this flag will be dealt with in the following commit. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a129077cc37202a00dd666bd5365c3f61ea2e80 --- libavcodec/internal.h | 4 libavcodec/libaomdec.c | 1 + libavcodec/libaomenc.c | 1 + libavcodec/libdav1d.c | 3 ++- libavcodec/libdavs2.c | 1 + libavcodec/libkvazaar.c | 3 ++- libavcodec/libopenh264enc.c | 3 ++- libavcodec/librav1e.c | 2 +- libavcodec/libsvtav1.c | 1 + libavcodec/libuavs3d.c | 1 + libavcodec/libvpxdec.c | 2 ++ libavcodec/libvpxenc.c | 2 ++ libavcodec/libx264.c| 15 --- libavcodec/libx265.c| 1 + libavcodec/libxavs.c| 1 + libavcodec/libxavs2.c | 1 + libavcodec/pthread.c| 2 +- libavcodec/utils.c | 2 +- 18 files changed, 33 insertions(+), 13 deletions(-) diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 400ea508ef..b57b996816 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -74,6 +74,10 @@ * uses ff_thread_report/await_progress(). */ #define FF_CODEC_CAP_ALLOCATE_PROGRESS (1 << 6) +/** + * Codec handles avctx->thread_count == 0 (auto) internally. + */ +#define FF_CODEC_CAP_AUTO_THREADS (1 << 7) /** * AVCodec.codec_tags termination value diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 1430a651fe..327a5e18fb 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -237,6 +237,7 @@ AVCodec ff_libaom_av1_decoder = { .close = aom_free, .decode = aom_decode, .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_AUTO_THREADS, .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .wrapper_name = "libaom", }; diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 9a26b5f9ef..f99fdc0b73 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -1346,6 +1346,7 @@ AVCodec ff_libaom_av1_encoder = { .encode2= aom_encode, .close = aom_free, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS, +.caps_internal = FF_CODEC_CAP_AUTO_THREADS, .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .priv_class = &class_aom, .defaults = defaults, diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 383e4557b4..93aeab4cb1 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -485,7 +485,8 @@ AVCodec ff_libdav1d_decoder = { .flush = libdav1d_flush, .receive_frame = libdav1d_receive_frame, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS, -.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS | + FF_CODEC_CAP_AUTO_THREADS, .priv_class = &libdav1d_class, .wrapper_name = "libdav1d", }; diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index 218f3ec239..f6a03df373 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -222,6 +222,7 @@ AVCodec ff_libdavs2_decoder = { .decode = davs2_decode_frame, .flush = davs2_flush, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS, +.caps_internal = FF_CODEC_CAP_AUTO_THREADS, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .wrapper_name = "libdavs2", diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c index d94cf995c8..f75aa4eda3 100644 --- a/libavcodec/libkvazaar.c +++ b/libavcodec/libkvazaar.c @@ -341,7 +341,8 @@ AVCodec ff_libkvazaar_encoder = { .encode2 = libkvazaar_encode, .close= libkvazaar_close, -.caps_internal= FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal= FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | +
[FFmpeg-cvslog] cmdutils: replace strncpy() with direct assignment
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 11:19:27 2021 +0100| [b334fd39c9c00c739faeece87fa81c980c148a16] | committer: Anton Khirnov cmdutils: replace strncpy() with direct assignment Only one character is actually rewritten. Fixes truncation warnings, such as warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] in gcc 10.2.0 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b334fd39c9c00c739faeece87fa81c980c148a16 --- fftools/cmdutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 5e2d3c174b..fe424b6a4c 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -1163,13 +1163,13 @@ static void print_buildconf(int flags, int level) // Change all the ' --' strings to '~--' so that // they can be identified as tokens. while ((conflist = strstr(str, " --")) != NULL) { -strncpy(conflist, "~--", 3); +conflist[0] = '~'; } // Compensate for the weirdness this would cause // when passing 'pkg-config --static'. while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) { -strncpy(remove_tilde, "pkg-config ", 11); +remove_tilde[sizeof("pkg-config~") - 2] = ' '; } splitconf = strtok(str, "~"); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc: factor out encoder init/validation from avcodec_open2()
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 11:35:47 2021 +0100| [3f53c848470cb8173699e0bd64e804a19af963f7] | committer: Anton Khirnov lavc: factor out encoder init/validation from avcodec_open2() avcodec_open2() is massive, splitting it makes it more readable. Also, add a missing error code to ticks_per_frame sanity check. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f53c848470cb8173699e0bd64e804a19af963f7 --- libavcodec/encode.c | 157 + libavcodec/encode.h | 6 ++ libavcodec/utils.c | 166 +--- 3 files changed, 166 insertions(+), 163 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index abec818eb9..dd7cb33ad5 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -521,3 +521,160 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, return ret; } #endif + +int ff_encode_preinit(AVCodecContext *avctx) +{ +int i; +#if FF_API_CODED_FRAME +FF_DISABLE_DEPRECATION_WARNINGS +avctx->coded_frame = av_frame_alloc(); +if (!avctx->coded_frame) { +return AVERROR(ENOMEM); +} +FF_ENABLE_DEPRECATION_WARNINGS +#endif + +if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) { +av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n"); +return AVERROR(EINVAL); +} + +if (avctx->codec->sample_fmts) { +for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { +if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) +break; +if (avctx->channels == 1 && +av_get_planar_sample_fmt(avctx->sample_fmt) == +av_get_planar_sample_fmt(avctx->codec->sample_fmts[i])) { +avctx->sample_fmt = avctx->codec->sample_fmts[i]; +break; +} +} +if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { +char buf[128]; +snprintf(buf, sizeof(buf), "%d", avctx->sample_fmt); +av_log(avctx, AV_LOG_ERROR, "Specified sample format %s is invalid or not supported\n", + (char *)av_x_if_null(av_get_sample_fmt_name(avctx->sample_fmt), buf)); +return AVERROR(EINVAL); +} +} +if (avctx->codec->pix_fmts) { +for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++) +if (avctx->pix_fmt == avctx->codec->pix_fmts[i]) +break; +if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE +&& !((avctx->codec_id == AV_CODEC_ID_MJPEG || avctx->codec_id == AV_CODEC_ID_LJPEG) + && avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)) { +char buf[128]; +snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt); +av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n", + (char *)av_x_if_null(av_get_pix_fmt_name(avctx->pix_fmt), buf)); +return AVERROR(EINVAL); +} +if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ420P || +avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ411P || +avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ422P || +avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ440P || +avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P) +avctx->color_range = AVCOL_RANGE_JPEG; +} +if (avctx->codec->supported_samplerates) { +for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++) +if (avctx->sample_rate == avctx->codec->supported_samplerates[i]) +break; +if (avctx->codec->supported_samplerates[i] == 0) { +av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n", + avctx->sample_rate); +return AVERROR(EINVAL); +} +} +if (avctx->sample_rate < 0) { +av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n", +avctx->sample_rate); +return AVERROR(EINVAL); +} +if (avctx->codec->channel_layouts) { +if (!avctx->channel_layout) { +av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n"); +} else { +for (i = 0; avctx->codec->channel_layouts[i] != 0; i++) +if (avctx->channel_layout == avctx->codec->channel_layouts[i]) +break; +if (avctx->codec->channel_layouts[i] == 0) { +char buf[512]; +av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); +av_log(
[FFmpeg-cvslog] lavc/encode: reindent after previous commit
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 11:39:42 2021 +0100| [dbb1dfabb70ef0607367763806bd1dd843f8a65f] | committer: Anton Khirnov lavc/encode: reindent after previous commit > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbb1dfabb70ef0607367763806bd1dd843f8a65f --- libavcodec/encode.c | 246 ++-- 1 file changed, 123 insertions(+), 123 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index dd7cb33ad5..63453b7688 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -524,157 +524,157 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, int ff_encode_preinit(AVCodecContext *avctx) { -int i; +int i; #if FF_API_CODED_FRAME FF_DISABLE_DEPRECATION_WARNINGS -avctx->coded_frame = av_frame_alloc(); -if (!avctx->coded_frame) { -return AVERROR(ENOMEM); -} +avctx->coded_frame = av_frame_alloc(); +if (!avctx->coded_frame) { +return AVERROR(ENOMEM); +} FF_ENABLE_DEPRECATION_WARNINGS #endif -if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) { -av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n"); -return AVERROR(EINVAL); -} +if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) { +av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n"); +return AVERROR(EINVAL); +} -if (avctx->codec->sample_fmts) { -for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { -if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) -break; -if (avctx->channels == 1 && -av_get_planar_sample_fmt(avctx->sample_fmt) == -av_get_planar_sample_fmt(avctx->codec->sample_fmts[i])) { -avctx->sample_fmt = avctx->codec->sample_fmts[i]; -break; -} -} -if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { -char buf[128]; -snprintf(buf, sizeof(buf), "%d", avctx->sample_fmt); -av_log(avctx, AV_LOG_ERROR, "Specified sample format %s is invalid or not supported\n", - (char *)av_x_if_null(av_get_sample_fmt_name(avctx->sample_fmt), buf)); -return AVERROR(EINVAL); +if (avctx->codec->sample_fmts) { +for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { +if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) +break; +if (avctx->channels == 1 && +av_get_planar_sample_fmt(avctx->sample_fmt) == +av_get_planar_sample_fmt(avctx->codec->sample_fmts[i])) { +avctx->sample_fmt = avctx->codec->sample_fmts[i]; +break; } } -if (avctx->codec->pix_fmts) { -for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++) -if (avctx->pix_fmt == avctx->codec->pix_fmts[i]) -break; -if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE -&& !((avctx->codec_id == AV_CODEC_ID_MJPEG || avctx->codec_id == AV_CODEC_ID_LJPEG) - && avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)) { -char buf[128]; -snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt); -av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n", - (char *)av_x_if_null(av_get_pix_fmt_name(avctx->pix_fmt), buf)); -return AVERROR(EINVAL); -} -if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ420P || -avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ411P || -avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ422P || -avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ440P || -avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P) -avctx->color_range = AVCOL_RANGE_JPEG; +if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { +char buf[128]; +snprintf(buf, sizeof(buf), "%d", avctx->sample_fmt); +av_log(avctx, AV_LOG_ERROR, "Specified sample format %s is invalid or not supported\n", + (char *)av_x_if_null(av_get_sample_fmt_name(avctx->sample_fmt), buf)); +return AVERROR(EINVAL); } -if (avctx->codec->supported_samplerates) { -for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++) -if (avctx->sample_rate == avctx->codec->supported_samplerates[i]) -break; -if (avctx->codec->supported_samplerates[i] == 0) { -av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n", - avctx->sampl
[FFmpeg-cvslog] lavc: factor decoder validation/setup from avcodec_open2()
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 11:35:47 2021 +0100| [20aec597d05f1930dbd4e4c5ab8ee837dea5b5f3] | committer: Anton Khirnov lavc: factor decoder validation/setup from avcodec_open2() > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=20aec597d05f1930dbd4e4c5ab8ee837dea5b5f3 --- libavcodec/decode.c | 41 + libavcodec/decode.h | 6 ++ libavcodec/utils.c | 46 +- 3 files changed, 52 insertions(+), 41 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 5f7e9bda3e..c8e9be3a13 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -2004,3 +2004,44 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } + +int ff_decode_preinit(AVCodecContext *avctx) +{ +/* if the decoder init function was already called previously, + * free the already allocated subtitle_header before overwriting it */ +av_freep(&avctx->subtitle_header); + +#if FF_API_THREAD_SAFE_CALLBACKS +FF_DISABLE_DEPRECATION_WARNINGS +if ((avctx->thread_type & FF_THREAD_FRAME) && +avctx->get_buffer2 != avcodec_default_get_buffer2 && +!avctx->thread_safe_callbacks) { +av_log(avctx, AV_LOG_WARNING, "Requested frame threading with a " + "custom get_buffer2() implementation which is not marked as " + "thread safe. This is not supported anymore, make your " + "callback thread-safe.\n"); +} +FF_ENABLE_DEPRECATION_WARNINGS +#endif + +if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) { +av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", + avctx->codec->max_lowres); +avctx->lowres = avctx->codec->max_lowres; +} + +avctx->pts_correction_num_faulty_pts = +avctx->pts_correction_num_faulty_dts = 0; +avctx->pts_correction_last_pts = +avctx->pts_correction_last_dts = INT64_MIN; + +if ( !CONFIG_GRAY && avctx->flags & AV_CODEC_FLAG_GRAY +&& avctx->codec_descriptor->type == AVMEDIA_TYPE_VIDEO) +av_log(avctx, AV_LOG_WARNING, + "gray decoding requested but not enabled at configuration time\n"); +if (avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) { +avctx->export_side_data |= AV_CODEC_EXPORT_DATA_MVS; +} + +return 0; +} diff --git a/libavcodec/decode.h b/libavcodec/decode.h index d4e3f5c5b5..a865fe954f 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -85,4 +85,10 @@ int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx, int ff_attach_decode_data(AVFrame *frame); +/** + * Perform decoder initialization and validation. + * Called when opening the decoder, before the AVCodec.init() call. + */ +int ff_decode_preinit(AVCodecContext *avctx); + #endif /* AVCODEC_DECODE_H */ diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 933af49c11..3eae531297 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -657,11 +657,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } } -/* if the decoder init function was already called previously, - * free the already allocated subtitle_header before overwriting it */ -if (av_codec_is_decoder(codec)) -av_freep(&avctx->subtitle_header); - if (avctx->channels > FF_SANE_NB_CHANNELS || avctx->channels < 0) { av_log(avctx, AV_LOG_ERROR, "Too many or invalid channels: %d\n", avctx->channels); ret = AVERROR(EINVAL); @@ -687,19 +682,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code goto free_and_end; } -#if FF_API_THREAD_SAFE_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS -if ((avctx->thread_type & FF_THREAD_FRAME) && -avctx->get_buffer2 != avcodec_default_get_buffer2 && -!avctx->thread_safe_callbacks) { -av_log(avctx, AV_LOG_WARNING, "Requested frame threading with a " - "custom get_buffer2() implementation which is not marked as " - "thread safe. This is not supported anymore, make your " - "callback thread-safe.\n"); -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - avctx->codec = codec; if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) && avctx->codec_id == AV_CODEC_ID_NONE) { @@ -764,30 +746,12 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) avctx->thread_count = 1; -if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) { -av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", - avctx->codec->max_lowres); -avctx->lowres = avctx->codec->max_lowres; -} - -if (av_codec_is_encoder(avctx->code
[FFmpeg-cvslog] lavc: move decoder bsf init into decoder-specific code
ffmpeg | branch: master | Anton Khirnov | Tue Mar 9 12:00:09 2021 +0100| [b006a84a97e7c8131a9e561d6c642edef6215977] | committer: Anton Khirnov lavc: move decoder bsf init into decoder-specific code > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b006a84a97e7c8131a9e561d6c642edef6215977 --- libavcodec/decode.c | 8 +++- libavcodec/decode.h | 6 -- libavcodec/utils.c | 6 -- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index c8e9be3a13..5a00aeedae 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -185,7 +185,7 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt) return 0; } -int ff_decode_bsfs_init(AVCodecContext *avctx) +static int decode_bsfs_init(AVCodecContext *avctx) { AVCodecInternal *avci = avctx->internal; int ret; @@ -2007,6 +2007,8 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) int ff_decode_preinit(AVCodecContext *avctx) { +int ret = 0; + /* if the decoder init function was already called previously, * free the already allocated subtitle_header before overwriting it */ av_freep(&avctx->subtitle_header); @@ -2043,5 +2045,9 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->export_side_data |= AV_CODEC_EXPORT_DATA_MVS; } +ret = decode_bsfs_init(avctx); +if (ret < 0) +return ret; + return 0; } diff --git a/libavcodec/decode.h b/libavcodec/decode.h index a865fe954f..1467b1eb33 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -69,12 +69,6 @@ int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt); */ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame); -/** - * Called during avcodec_open2() to initialize avctx->internal->bsf. - * The bsf should be freed with av_bsf_free(). - */ -int ff_decode_bsfs_init(AVCodecContext *avctx); - /** * Make sure avctx.hw_frames_ctx is set. If it's not set, the function will * try to allocate it from hw_device_ctx. If that is not possible, an error diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 3eae531297..c072ca5489 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -730,12 +730,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code goto free_and_end; } -if (av_codec_is_decoder(avctx->codec)) { -ret = ff_decode_bsfs_init(avctx); -if (ret < 0) -goto free_and_end; -} - if (HAVE_THREADS && !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { ret = ff_thread_init(avctx); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc: drop unused argument from lock_avcodec()
ffmpeg | branch: master | Anton Khirnov | Wed Mar 10 09:01:50 2021 +0100| [30a69b1625818dda865221c3368155f398540c7b] | committer: Anton Khirnov lavc: drop unused argument from lock_avcodec() > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30a69b1625818dda865221c3368155f398540c7b --- libavcodec/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index cf811eaeaa..71dbcb19d8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -530,7 +530,7 @@ static int64_t get_bit_rate(AVCodecContext *ctx) } -static void lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec) +static void lock_avcodec(const AVCodec *codec) { if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) ff_mutex_lock(&codec_mutex); @@ -570,7 +570,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if (options) av_dict_copy(&tmp, *options, 0); -lock_avcodec(avctx, codec); +lock_avcodec(codec); avci = av_mallocz(sizeof(*avci)); if (!avci) { @@ -725,7 +725,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) { unlock_avcodec(codec); //we will instantiate a few encoders thus kick the counter to prevent false detection of a problem ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL); -lock_avcodec(avctx, codec); +lock_avcodec(codec); if (ret < 0) goto free_and_end; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc: drop ff_ prefix from ff_(un)lock_avcodec
ffmpeg | branch: master | Anton Khirnov | Wed Mar 10 09:01:00 2021 +0100| [55c083f08a8dd7aaabc5c6da46a4b51041686f98] | committer: Anton Khirnov lavc: drop ff_ prefix from ff_(un)lock_avcodec It is unnecessary and misleading, as those are static functions. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55c083f08a8dd7aaabc5c6da46a4b51041686f98 --- libavcodec/utils.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c072ca5489..cf811eaeaa 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -530,13 +530,13 @@ static int64_t get_bit_rate(AVCodecContext *ctx) } -static void ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec) +static void lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec) { if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) ff_mutex_lock(&codec_mutex); } -static void ff_unlock_avcodec(const AVCodec *codec) +static void unlock_avcodec(const AVCodec *codec) { if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) ff_mutex_unlock(&codec_mutex); @@ -570,7 +570,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if (options) av_dict_copy(&tmp, *options, 0); -ff_lock_avcodec(avctx, codec); +lock_avcodec(avctx, codec); avci = av_mallocz(sizeof(*avci)); if (!avci) { @@ -723,9 +723,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n"); if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) { -ff_unlock_avcodec(codec); //we will instantiate a few encoders thus kick the counter to prevent false detection of a problem +unlock_avcodec(codec); //we will instantiate a few encoders thus kick the counter to prevent false detection of a problem ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL); -ff_lock_avcodec(avctx, codec); +lock_avcodec(avctx, codec); if (ret < 0) goto free_and_end; } @@ -834,7 +834,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } end: -ff_unlock_avcodec(codec); +unlock_avcodec(codec); if (options) { av_dict_free(options); *options = tmp; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. b442e76 web/download: add prominent signing key download link
The branch, master has been updated via b442e762543ee063ca04e793f9bc830481397835 (commit) via 0745e67732776c48b69ca9441debb54ac9a891e5 (commit) via 7cbba730871e4aee09386b6361acfd748fb232b1 (commit) from 0e4960ddf41084e99ce5b279a8f942f631770161 (commit) - Log - commit b442e762543ee063ca04e793f9bc830481397835 Author: Zane van Iperen AuthorDate: Wed Feb 24 13:45:42 2021 +1000 Commit: Thilo Borgmann CommitDate: Tue Mar 16 14:29:13 2021 +0100 web/download: add prominent signing key download link Signed-off-by: Zane van Iperen diff --git a/src/download b/src/download index b82f446..a6483a6 100644 --- a/src/download +++ b/src/download @@ -5,6 +5,11 @@ Download Source Code ffmpeg-snapshot.tar.bz2 + + + + Download PGP Signing Key + ffmpeg-devel.asc More releases commit 0745e67732776c48b69ca9441debb54ac9a891e5 Author: Zane van Iperen AuthorDate: Wed Feb 24 12:33:08 2021 +1000 Commit: Thilo Borgmann CommitDate: Tue Mar 16 14:29:13 2021 +0100 web/download: add signing key and verification instructions As per discussion at https://ffmpeg.org/pipermail/ffmpeg-devel/2021-February/276752.html Signed-off-by: Zane van Iperen diff --git a/htdocs/ffmpeg-devel.asc b/htdocs/ffmpeg-devel.asc new file mode 100644 index 000..3a4d521 --- /dev/null +++ b/htdocs/ffmpeg-devel.asc @@ -0,0 +1,30 @@ +-BEGIN PGP PUBLIC KEY BLOCK- + +mQENBE22rV0BCAC3DzRmA2XlhrqYv9HKoEvNHHf+PzosmCTHmYhWHDqvBxPkSvCl +ipkbvJ4pBnVvcX6mW5QyKhspHm5j1X5ibe9Bt9/chS/obnIobmvF8shSUgjQ0qRW +9c1aWOjvT26SxYQ1y9TmYCFwixeydGFHYKjAim+evGUccni5KMlfPoT3VTPtim78 +ufkr3E9Nco/Mobn/8APO0NmLEGWAM6ln/8J/c9h6a1QKnQyBqWfT0YnAaebafFaZ +YwOtRdDG54VbJ4xwcHbCj5cKhTABk/QtBzDvnW4bG+uSpqdHbFZEY2JpURDuj/T3 +NudKQGzn0bYNpY1XY2l0pqs/btKHnBW0fVMjABEBAAG0NEZGbXBlZyByZWxlYXNl +IHNpZ25pbmcga2V5IDxmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZz6JATgEEwECACIF +Ak22rV0CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJELQyLwTWdljYKxUH +/1fqzl7SKie2g4t4PJbqUbkLuMsC+CP6gp0dcVZOHkuUYAoD3PM3iVxpLBVyKIXI +g7wMSTAtlIcYnzhWIpnoCBes6/O2Mrq6xHgGeTp6CDcm3LmmSYR1f5KdD8KUaA+l +c/M/1fEnwrSs/UGDk6R6iUmbqwxPsbozlOvmUHOLbDZBnKrk9XfAJdUhAuFACrSA +T+KF1jniz0OfNGd23SaHWRCphoRW9pXDc5FfkdaueBUvBvGv19ZNcDhcxT3/u6z2 +DaUFC0rLWqk8obo951jVvi/zOhB94Pw6u1SLvcTq3V1q5URWJtgSbpih9VRqxUbQ +NbXduKGzbHz6Vwpkupz4JRe5AQ0ETbatXQEIANjYrygJi/fn1nlSg5Mz0l9KHDm4 +yfWtaOrXUjJcyiGe4G0XXJLGh45qxJ0DOKzi9id+9W4jby+kKuzG9O6Vn0iDeODO +aOGnz4ua7Vu6d0AbYfNXZPWge/GCodo/ZD/qri1tPkLmRtT/sniahwy6LruPNHfF +SRoNIjwbcD/IL+EbY1pL1/IFSzEAA1ZZamgmHgB7o9pwDIkK6HuvHMR/Y5MsoMfV +fWV3ZGtA6v9z51CvnHsHPsADRSnUp7aYtR412SiAO4XodMLTA92L3LxgYhI4ma7D +XZ8jgKg4JkKO+DXmoU63HtRdq/HZjeXJKk1JGJF3zCvP3DyIzZ8LWIjN8t0AEQEA +AYkBHwQYAQIACQUCTbatXQIbDAAKCRC0Mi8E1nZY2LS8B/0bMoUAl4X9D0WQbL4l +U0czCIOKOsvbHpIxivjCnOQxU23+PV5WZdoCCpSuAHGv+2OHzhNrij++P9BNTJeQ +skxdS9FH4MZwy1IRSPrxegSxbCUpBI1rd0Zf7qb9BNPrHPTueWFV1uExOSB2Apsv +WrKo2D8mR0uZAPYfYl2ToFVoa5PR7/+ii9WiJr/flF6qm7hoLpI5Bm4VcZh2GPsJ +9Vo/8x/qOGwtdWHqBykYloKsrwD4U69rjn+d9feLoPBRgoVroXWQttt0sUnyoudz ++x8ETJgPoNK3kQoDagApj4qAt83Ayac3HzNIuEJ7LdvfINIOprujnJ9vH4n04XLg +I4EZ +=Rjbw +-END PGP PUBLIC KEY BLOCK- diff --git a/src/download b/src/download index 3f0e4d2..b82f446 100644 --- a/src/download +++ b/src/download @@ -249,6 +249,40 @@ + + +Release Verification + + +All FFmpeg releases are cryptographically signed with +our public PGP key and should be verified for +authenticity. + + pub rsa2048 2011-04-26 [SC] +FCF986EA15E6E293A5644F10B4322F04D67658D8 +uid [ full ] FFmpeg release signing key+sub rsa2048 2011-04-26 [E] + + +To verify a release: + + Import our public key into your local keyring: +$ curl https://ffmpeg.org/ffmpeg-devel.asc | gpg --import + + +Download a release tarball and its corresponding signature. + + +Verify the signature: +$ gpg --verify ffmpeg-4.3.2.tar.xz.asc ffmpeg-4.3.2.tar.xz +gpg: Signature made Sun 21 Feb 2021 06:35:15 AEST +gpg:using RSA key FCF986EA15E6E293A5644F10B4322F04D67658D8 +gpg:issuer "ffmpeg-de...@ffmpeg.org" +gpg: Good signature from "FFmpeg release signing key " [full] + + + + Releases commit 7cbba730871e4aee09386b6361acfd748fb232b1 Author: Zane van Iperen AuthorDate: Wed Feb 24 12:38:20 2021 +1000 Commit: Thilo Borgmann CommitDate: Tue Mar 16 14:29:13 2021 +0100 gitignore: add /node_modules/ Signed-off-by: Zane van Iperen diff --git a/.gitignore b/.gitignore index b215828..60a2b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /htdocs/components /htdocs/style.less /htdocs/fonts/*.woff2 +/node_modules/ --- Summary of changes: .gi
[FFmpeg-cvslog] avformat/aviobuf: don't reduce short seek threshold
ffmpeg | branch: master | Andriy Gelman | Sat Mar 13 23:54:32 2021 -0500| [9383885c0d2155b1f9e65c08c3f35d190ae2ba98] | committer: Andriy Gelman avformat/aviobuf: don't reduce short seek threshold Commit 8c8e5d5286bf598a89ef9993a2cf6ea409d03a32 added a way to reduce seek time by waiting for the windowed tcp packets instead of creating a new socket connection. It implemented this by overwriting s->short_seek_threshold in avio_seek(). However, s->short_seek_threshold could already be set and be higher than the threshold set by the protocol (i.e. s->short_seek_threshold is set in ff_configure_buffers_for_index()). This new feature was only enabled for tls connections in 70d8077b795766e2486e6ec8110f22a97362d6d6. As in Ticket #9148 it reduced performance because instead of waiting to refill the AVIOContext buffers with an existing connections, a new HTTP request was often made instead. Fixes Ticket #9148. Reviewed-by: Martin Storsjö Signed-off-by: Andriy Gelman > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9383885c0d2155b1f9e65c08c3f35d190ae2ba98 --- libavformat/aviobuf.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 78cc60b2ae..518cb11129 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -283,13 +283,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) if (offset < 0) return AVERROR(EINVAL); -if (s->short_seek_get) { -short_seek = s->short_seek_get(s->opaque); -/* fallback to default short seek */ -if (short_seek <= 0) -short_seek = s->short_seek_threshold; -} else -short_seek = s->short_seek_threshold; +short_seek = s->short_seek_threshold; +if (s->short_seek_get) +short_seek = FFMAX(s->short_seek_get(s->opaque), short_seek); offset1 = offset - pos; // "offset1" is the relative offset from the beginning of s->buffer s->buf_ptr_max = FFMAX(s->buf_ptr_max, s->buf_ptr); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".