diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-21 10:03:27 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-21 10:03:27 +0000 |
commit | 4278662d45d3210e497a152f3cab982d76a6e9dc (patch) | |
tree | 9f658860099562e7b51515f1c450753b24443a49 /libavformat/movenc.c | |
parent | c72e05ba0ff0f5b28ad193ba316cb9bfed493df9 (diff) | |
download | ffmpeg-4278662d45d3210e497a152f3cab982d76a6e9dc.tar.gz |
treat frame_size > 1 as compressed audio
Originally committed as revision 8461 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 09bea76f41..c5f777d023 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1479,19 +1479,13 @@ static int mov_write_header(AVFormatContext *s) track->tag = mov_find_audio_codec_tag(s, track); track->timescale = st->codec->sample_rate; av_set_pts_info(st, 64, 1, st->codec->sample_rate); - switch(track->enc->codec_id){ - case CODEC_ID_MP3: - case CODEC_ID_AAC: - case CODEC_ID_AMR_NB: - case CODEC_ID_AMR_WB: - track->audio_vbr = 1; - break; - default: - track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; - } - if (!st->codec->frame_size) { + if(!st->codec->frame_size){ av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i); return -1; + }else if(st->codec->frame_size > 1){ /* assume compressed audio */ + track->audio_vbr = 1; + }else{ + track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; } } } |