From 6f9d46539bce25828e3229db6cd9c0dbae1f3e11 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期日, 19 一月 2020 11:43:34 +0800 Subject: [PATCH] update ffmpeg --- csrc/thirdparty/ffmpeg/include/libavutil/lfg.h | 15 ++++++++++++--- csrc/wrapper.cpp | 13 ++++++++----- csrc/thirdparty/ffmpeg/include/libavutil/ffversion.h | 2 +- csrc/thirdparty/ffmpeg/lib/libavfilter.a | 0 csrc/ffmpeg/configure/conf.cpp | 2 +- csrc/thirdparty/ffmpeg/lib/libavcodec.a | 0 csrc/thirdparty/ffmpeg/lib/libavformat.a | 0 csrc/thirdparty/ffmpeg/lib/libavutil.a | 0 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/csrc/ffmpeg/configure/conf.cpp b/csrc/ffmpeg/configure/conf.cpp index d836840..43e45ac 100644 --- a/csrc/ffmpeg/configure/conf.cpp +++ b/csrc/ffmpeg/configure/conf.cpp @@ -13,7 +13,7 @@ av_register_all(); avfilter_register_all(); avformat_network_init(); - av_log_set_level(AV_LOG_ERROR); + av_log_set_level(AV_LOG_VERBOSE); } std::string getAVErrorDesc(const int code){ diff --git a/csrc/thirdparty/ffmpeg/include/libavutil/ffversion.h b/csrc/thirdparty/ffmpeg/include/libavutil/ffversion.h index f4377b7..e5c2702 100644 --- a/csrc/thirdparty/ffmpeg/include/libavutil/ffversion.h +++ b/csrc/thirdparty/ffmpeg/include/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "4.2" +#define FFMPEG_VERSION "4.2.2" #endif /* AVUTIL_FFVERSION_H */ diff --git a/csrc/thirdparty/ffmpeg/include/libavutil/lfg.h b/csrc/thirdparty/ffmpeg/include/libavutil/lfg.h index 03f779a..2b66920 100644 --- a/csrc/thirdparty/ffmpeg/include/libavutil/lfg.h +++ b/csrc/thirdparty/ffmpeg/include/libavutil/lfg.h @@ -24,6 +24,12 @@ #include <stdint.h> +/** + * Context structure for the Lagged Fibonacci PRNG. + * The exact layout, types and content of this struct may change and should + * not be accessed directly. Only its sizeof() is guranteed to stay the same + * to allow easy instanciation. + */ typedef struct AVLFG { unsigned int state[64]; int index; @@ -45,8 +51,9 @@ * it may be good enough and faster for your specific use case. */ static inline unsigned int av_lfg_get(AVLFG *c){ - c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; - return c->state[c->index++ & 63]; + unsigned a = c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; + c->index += 1U; + return a; } /** @@ -57,7 +64,9 @@ static inline unsigned int av_mlfg_get(AVLFG *c){ unsigned int a= c->state[(c->index-55) & 63]; unsigned int b= c->state[(c->index-24) & 63]; - return c->state[c->index++ & 63] = 2*a*b+a+b; + a = c->state[c->index & 63] = 2*a*b+a+b; + c->index += 1U; + return a; } /** diff --git a/csrc/thirdparty/ffmpeg/lib/libavcodec.a b/csrc/thirdparty/ffmpeg/lib/libavcodec.a index 05f35ec..16293e8 100644 --- a/csrc/thirdparty/ffmpeg/lib/libavcodec.a +++ b/csrc/thirdparty/ffmpeg/lib/libavcodec.a Binary files differ diff --git a/csrc/thirdparty/ffmpeg/lib/libavfilter.a b/csrc/thirdparty/ffmpeg/lib/libavfilter.a index d1b7d7e..68a18fa 100644 --- a/csrc/thirdparty/ffmpeg/lib/libavfilter.a +++ b/csrc/thirdparty/ffmpeg/lib/libavfilter.a Binary files differ diff --git a/csrc/thirdparty/ffmpeg/lib/libavformat.a b/csrc/thirdparty/ffmpeg/lib/libavformat.a index ef6f946..1eb63a8 100644 --- a/csrc/thirdparty/ffmpeg/lib/libavformat.a +++ b/csrc/thirdparty/ffmpeg/lib/libavformat.a Binary files differ diff --git a/csrc/thirdparty/ffmpeg/lib/libavutil.a b/csrc/thirdparty/ffmpeg/lib/libavutil.a index 81936d7..876710b 100644 --- a/csrc/thirdparty/ffmpeg/lib/libavutil.a +++ b/csrc/thirdparty/ffmpeg/lib/libavutil.a Binary files differ diff --git a/csrc/wrapper.cpp b/csrc/wrapper.cpp index cd82a90..3e34b2c 100644 --- a/csrc/wrapper.cpp +++ b/csrc/wrapper.cpp @@ -105,16 +105,19 @@ prop.gpu_acc_ = !cpu_; std::unique_ptr<FormatIn> in(new FormatIn(prop.gpuAccl())); - AVDictionary *avdic = prop.optsFormat(); int flag = -1; if (gb_){ flag = in->openGb28181(input, NULL); }else{ - flag = in->open(input, &avdic); + AVDictionary *avdic = prop.optsFormat(); + if(avdic){ + flag = in->open(input, &avdic); + av_dict_free(&avdic); + }else{ + flag = in->open(input, NULL); + } } - if(avdic){ - av_dict_free(&avdic); - } + if(flag == 0){ if(!in->findStreamInfo(NULL)){ logIt("can't find video stream\n"); -- Gitblit v1.8.0