胡斌

fix bug about using LIBAVCODEC_VERSION_MAJOR version,leading to wrong pcm format for aac encoding

... ... @@ -289,7 +289,7 @@ int CAVTranscoder::open_output_file(const char *filename)
for (; it != decoders_got_frame.end(); it++) {
AVFrame * pFrame = (*it)->_cur_a_frame;
if (pFrame) {
#if LIBAVCODEC_VERSION_MAJOR < 58
#if LIBAVCODEC_VERSION_MAJOR < 57
int16_t * psrc = (int16_t *)pFrame->extended_data[0];
int16_t * pdst = (int16_t *)pDstFrame->extended_data[0];
#else
... ...
#include "VideoDecoder.h"
extern AVRational timebase_ms;
CVideoDecoder::CVideoDecoder() :
... ...
... ... @@ -51,7 +51,9 @@ extern "C" {
#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
}
#ifdef WIN32
#ifdef ADD_FFMPEG_LIB
#pragma comment(lib, "avcodec.lib")
#pragma comment(lib, "avdevice.lib")
#pragma comment(lib, "avfilter.lib")
... ... @@ -60,9 +62,7 @@ extern "C" {
#pragma comment(lib, "postproc.lib")
#pragma comment(lib, "swresample.lib")
#pragma comment(lib, "swscale.lib")
#endif
#if _MSC_VER
#define snprintf _snprintf
#define PRIu64 "I64u"
#define PRId64 "I64d"
... ... @@ -70,6 +70,8 @@ extern "C" {
#define PRIX64 "I64X"
#endif
typedef struct FilteringContext {
AVFilterContext *buffersink_ctx;
AVFilterContext *buffersrc_ctx;
... ... @@ -80,7 +82,7 @@ typedef struct FilteringContext {
#define AFRAME_DURATION_MS 21.333333
#define VFRAME_DURATION_MS 50
#if LIBAVCODEC_VERSION_MAJOR < 58
#if LIBAVCODEC_VERSION_MAJOR < 57
#define PCM_FORMAT_FOR_AAC_ENCODE AV_SAMPLE_FMT_S16
#else
#define PCM_FORMAT_FOR_AAC_ENCODE AV_SAMPLE_FMT_FLTP
... ...
... ... @@ -52,7 +52,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ADD_FFMPEG_LIB;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\liveAssistant\third-lib\ffmpeg\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
... ... @@ -69,7 +69,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ADD_FFMPEG_LIB;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
... ...