av_find_stream_info(): Add a workaround for backwards compatible HE-AAC signaling.

The sample rate, frame size, and channel count from the container are
not reliable when backwards compatible signaling is used.

Originally committed as revision 22301 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Alex Converse 15 years ago
parent 3b2142af99
commit e7e291e960
  1. 2
      libavformat/avformat.h
  2. 5
      libavformat/utils.c

@ -22,7 +22,7 @@
#define AVFORMAT_AVFORMAT_H #define AVFORMAT_AVFORMAT_H
#define LIBAVFORMAT_VERSION_MAJOR 52 #define LIBAVFORMAT_VERSION_MAJOR 52
#define LIBAVFORMAT_VERSION_MINOR 54 #define LIBAVFORMAT_VERSION_MINOR 55
#define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

@ -2116,6 +2116,11 @@ int av_find_stream_info(AVFormatContext *ic)
for(i=0;i<ic->nb_streams;i++) { for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i]; st = ic->streams[i];
if (st->codec->codec_id == CODEC_ID_AAC) {
st->codec->sample_rate = 0;
st->codec->frame_size = 0;
st->codec->channels = 0;
}
if(st->codec->codec_type == CODEC_TYPE_VIDEO){ if(st->codec->codec_type == CODEC_TYPE_VIDEO){
/* if(!st->time_base.num) /* if(!st->time_base.num)
st->time_base= */ st->time_base= */

Loading…
Cancel
Save