Skip to content
Snippets Groups Projects
Commit cf74dd4a authored by Baptiste Coudurier's avatar Baptiste Coudurier
Browse files

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
parent 235a51ad
No related branches found
No related tags found
No related merge requests found
...@@ -1604,12 +1604,13 @@ static int mov_write_header(AVFormatContext *s) ...@@ -1604,12 +1604,13 @@ static int mov_write_header(AVFormatContext *s)
}else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){
track->timescale = st->codec->sample_rate; track->timescale = st->codec->sample_rate;
av_set_pts_info(st, 64, 1, 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); av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i);
return -1; return -1;
}else if(st->codec->frame_size > 1){ /* assume compressed audio */ }else if(st->codec->frame_size > 1){ /* assume compressed audio */
track->audio_vbr = 1; track->audio_vbr = 1;
}else{ }else{
st->codec->frame_size = 1;
track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
} }
if(track->mode != MODE_MOV && if(track->mode != MODE_MOV &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment