From 9e74db685063170d8f30191a17cd16769488d156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 17 Jun 2012 00:29:26 +0300 Subject: [PATCH] mov: Support muxing/demuxing iLBC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The packet size, signalled via block_align, has to be passed via the container. Signed-off-by: Martin Storsjö --- libavformat/isom.c | 1 + libavformat/mov.c | 1 + libavformat/movenc.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) 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;