Mercurial > libavformat.hg
comparison movenc.c @ 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 | 76e7b6822fa6 |
children | 7c71e9cabf0e |
comparison
equal
deleted
inserted
replaced
3895:5554c668388b | 3896:c472578fa54d |
---|---|
1602 "file may not be playable by quicktime. Specify a shorter timebase\n" | 1602 "file may not be playable by quicktime. Specify a shorter timebase\n" |
1603 "or choose different container.\n"); | 1603 "or choose different container.\n"); |
1604 }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ | 1604 }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ |
1605 track->timescale = st->codec->sample_rate; | 1605 track->timescale = st->codec->sample_rate; |
1606 av_set_pts_info(st, 64, 1, st->codec->sample_rate); | 1606 av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
1607 if(!st->codec->frame_size){ | 1607 if(!st->codec->frame_size && !av_get_bits_per_sample(st->codec->codec_id)) { |
1608 av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i); | 1608 av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i); |
1609 return -1; | 1609 return -1; |
1610 }else if(st->codec->frame_size > 1){ /* assume compressed audio */ | 1610 }else if(st->codec->frame_size > 1){ /* assume compressed audio */ |
1611 track->audio_vbr = 1; | 1611 track->audio_vbr = 1; |
1612 }else{ | 1612 }else{ |
1613 st->codec->frame_size = 1; | |
1613 track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; | 1614 track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; |
1614 } | 1615 } |
1615 if(track->mode != MODE_MOV && | 1616 if(track->mode != MODE_MOV && |
1616 track->enc->codec_id == CODEC_ID_MP3 && track->enc->sample_rate < 16000){ | 1617 track->enc->codec_id == CODEC_ID_MP3 && track->enc->sample_rate < 16000){ |
1617 av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n", | 1618 av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n", |