summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-06-17 00:29:26 +0300
committerMartin Storsjö <martin@martin.st>2012-06-18 22:00:35 +0300
commit9e74db685063170d8f30191a17cd16769488d156 (patch)
tree35b628443659b029b2f14a787362a9b0dd7046e3
parent3641b0489ce8517ae4ce75ea43c1445b6d1ad2f2 (diff)
mov: Support muxing/demuxing iLBC
The packet size, signalled via block_align, has to be passed via the container. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/isom.c1
-rw-r--r--libavformat/mov.c1
-rw-r--r--libavformat/movenc.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 3ea8ce135a..e5cde5a366 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -244,6 +244,7 @@ const AVCodecTag ff_codec_movaudio_tags[] = {
{ CODEC_ID_DVAUDIO, MKTAG('v', 'd', 'v', 'a') },
{ CODEC_ID_DVAUDIO, MKTAG('d', 'v', 'c', 'a') },
{ CODEC_ID_GSM, MKTAG('a', 'g', 's', 'm') },
+ { CODEC_ID_ILBC, MKTAG('i', 'l', 'b', 'c') },
{ CODEC_ID_MACE3, MKTAG('M', 'A', 'C', '3') },
{ CODEC_ID_MACE6, MKTAG('M', 'A', 'C', '6') },
{ CODEC_ID_MP1, MKTAG('.', 'm', 'p', '1') },
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1395259c5c..44dc2c821c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1456,6 +1456,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
case CODEC_ID_GSM:
case CODEC_ID_ADPCM_MS:
case CODEC_ID_ADPCM_IMA_WAV:
+ case CODEC_ID_ILBC:
st->codec->block_align = sc->bytes_per_frame;
break;
case CODEC_ID_ALAC:
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index bf888bc3be..350ac951f6 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3095,7 +3095,8 @@ static int mov_write_header(AVFormatContext *s)
}else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO){
track->timescale = st->codec->sample_rate;
/* set sample_size for PCM and ADPCM */
- if (av_get_bits_per_sample(st->codec->codec_id)) {
+ if (av_get_bits_per_sample(st->codec->codec_id) ||
+ st->codec->codec_id == CODEC_ID_ILBC) {
if (!st->codec->block_align) {
av_log(s, AV_LOG_ERROR, "track %d: codec block align is not set\n", i);
goto error;