diff --git a/CMakeModules/FindFFmpeg.cmake b/CMakeModules/FindFFmpeg.cmake index 1cccf4e62..6521783c4 100644 --- a/CMakeModules/FindFFmpeg.cmake +++ b/CMakeModules/FindFFmpeg.cmake @@ -32,6 +32,8 @@ MACRO(FFMPEG_FIND varname shortname headername) PATHS ${FFMPEG_ROOT}/include $ENV{FFMPEG_DIR}/include + ${FFMPEG_ROOT} + $ENV{FFMPEG_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local/include @@ -49,6 +51,8 @@ MACRO(FFMPEG_FIND varname shortname headername) PATHS ${FFMPEG_ROOT}/include $ENV{FFMPEG_DIR}/include + ${FFMPEG_ROOT} + $ENV{FFMPEG_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local/include @@ -67,6 +71,8 @@ MACRO(FFMPEG_FIND varname shortname headername) PATHS ${FFMPEG_ROOT}/lib $ENV{FFMPEG_DIR}/lib + ${FFMPEG_ROOT}/lib${shortname} + $ENV{FFMPEG_DIR}/lib${shortname} ~/Library/Frameworks /Library/Frameworks /usr/local/lib diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp index b16e92f54..a290033eb 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp @@ -128,8 +128,7 @@ void FFmpegDecoderAudio::open(AVStream * const stream) m_frequency = m_context->sample_rate; m_nb_channels = m_context->channels; - OSG_NOTICE<<"FFmpegDecoderAudio::open(..), m_nb_channels="<sample_fmt="<sample_fmt<sample_fmt="<sample_fmt<sample_fmt) { @@ -149,6 +148,26 @@ void FFmpegDecoderAudio::open(AVStream * const stream) break; case AV_SAMPLE_FMT_DBL: throw std::runtime_error("unhandled audio format AV_SAMPLE_FMT_DBL"); + + case AV_SAMPLE_FMT_U8P: + m_sample_format = osg::AudioStream::SAMPLE_FORMAT_U8; + m_context->request_sample_fmt = av_get_packed_sample_fmt( m_context->sample_fmt ); + break; + case AV_SAMPLE_FMT_S16P: + m_sample_format = osg::AudioStream::SAMPLE_FORMAT_S16; + m_context->request_sample_fmt = av_get_packed_sample_fmt( m_context->sample_fmt ); + break; + case AV_SAMPLE_FMT_S32P: + m_sample_format = osg::AudioStream::SAMPLE_FORMAT_S32; + m_context->request_sample_fmt = av_get_packed_sample_fmt( m_context->sample_fmt ); + break; + case AV_SAMPLE_FMT_FLTP: + m_sample_format = osg::AudioStream::SAMPLE_FORMAT_F32; + m_context->request_sample_fmt = av_get_packed_sample_fmt( m_context->sample_fmt ); + break; + case AV_SAMPLE_FMT_DBLP: + throw std::runtime_error("unhandled audio format AV_SAMPLE_FMT_DBLP"); + default: throw std::runtime_error("unknown audio format"); }