changeset 3896:c472578fa54d libavformat

do not fail if audio is uncompressed and frame size is not set, just set it
author bcoudurier
date Fri, 05 Sep 2008 02:30:27 +0000
parents 5554c668388b
children 5aa1cbbd79e0
files movenc.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Fri Sep 05 02:20:33 2008 +0000
+++ b/movenc.c	Fri Sep 05 02:30:27 2008 +0000
@@ -1604,12 +1604,13 @@
         }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 &&