aboutsummaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Ruggles2012-03-21 14:36:33 -0400
committerJustin Ruggles2012-03-22 11:45:46 -0400
commit2c07c1804831fa0ae6d494a63fdd10facfd6074b (patch)
tree1d39273a0d1aae5368091d76eb83cec0d2acfc61 /libavformat
parent02f88eec1d9069ab6bb6c4177471226186647a8f (diff)
aiffdec: use av_get_audio_frame_duration() to set block_duration for AIFF-C
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aiffdec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index bbac1ab30e..a48d946880 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -123,28 +123,27 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size,
break;
case CODEC_ID_ADPCM_IMA_QT:
codec->block_align = 34*codec->channels;
- aiff->block_duration = 64;
break;
case CODEC_ID_MACE3:
codec->block_align = 2*codec->channels;
- aiff->block_duration = 6;
break;
case CODEC_ID_MACE6:
codec->block_align = 1*codec->channels;
- aiff->block_duration = 6;
break;
case CODEC_ID_GSM:
codec->block_align = 33;
- aiff->block_duration = 160;
break;
case CODEC_ID_QCELP:
codec->block_align = 35;
- aiff->block_duration = 160;
break;
default:
break;
}
size -= 4;
+
+ if (codec->block_align > 0)
+ aiff->block_duration = av_get_audio_frame_duration(codec,
+ codec->block_align);
} else {
/* Need the codec type */
codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample);