diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-09-05 02:30:27 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-09-05 02:30:27 +0000 |
commit | cf74dd4a5c17332fb2d5d340fdb129600253fe52 (patch) | |
tree | cdcfbc82d98ea74c133d0a391f2e7609c1197d20 | |
parent | 235a51ad316e120a07e88f073f7757fdd0f2afb7 (diff) | |
download | ffmpeg-cf74dd4a5c17332fb2d5d340fdb129600253fe52.tar.gz |
do not fail if audio is uncompressed and frame size is not set, just set it
Originally committed as revision 15216 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/movenc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 4eb5d689ba..01977c1941 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1604,12 +1604,13 @@ static int mov_write_header(AVFormatContext *s) }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ track->timescale = st->codec->sample_rate; av_set_pts_info(st, 64, 1, st->codec->sample_rate); - if(!st->codec->frame_size){ + if(!st->codec->frame_size && !av_get_bits_per_sample(st->codec->codec_id)) { 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{ + st->codec->frame_size = 1; track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; } if(track->mode != MODE_MOV && |