diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-11 08:17:38 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-11 08:17:38 +0000 |
commit | 709c9f8de3b6d9a69029b7f1138607a105db3d42 (patch) | |
tree | 88509f508581eef19f1f38909791861ca4ee8ee9 /libavformat/movenc.c | |
parent | 39883fffa775b4d1593fd663e891d313fb577816 (diff) | |
download | ffmpeg-streaming-709c9f8de3b6d9a69029b7f1138607a105db3d42.zip ffmpeg-streaming-709c9f8de3b6d9a69029b7f1138607a105db3d42.tar.gz |
support alac in ipod m4a format, tested on quicktime
Originally committed as revision 13739 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index b33fc24..2e80f1b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -397,6 +397,8 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track) mov_write_esds_tag(pb, track); else if(track->enc->codec_id == CODEC_ID_AMR_NB) mov_write_amr_tag(pb, track); + else if (track->enc->codec_id == CODEC_ID_ALAC) + mov_write_extradata_tag(pb, track); else if(track->vosLen > 0) mov_write_glbl_tag(pb, track); @@ -503,15 +505,27 @@ static const AVCodecTag mov_pix_fmt_tags[] = { { PIX_FMT_BGR32_1, MKTAG('r','a','w',' ') }, }; +static const AVCodecTag codec_ipod_tags[] = { + { CODEC_ID_H264, MKTAG('a','v','c','1') }, + { CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, + { CODEC_ID_AAC, MKTAG('m','p','4','a') }, + { CODEC_ID_ALAC, MKTAG('a','l','a','c') }, +}; + static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag = track->enc->codec_tag; - if (track->mode == MODE_MP4 || track->mode == MODE_PSP || track->mode == MODE_IPOD) { + if (track->mode == MODE_MP4 || track->mode == MODE_PSP) { if (!codec_get_tag(ff_mp4_obj_type, track->enc->codec_id)) return 0; if (track->enc->codec_id == CODEC_ID_H264) tag = MKTAG('a','v','c','1'); else if (track->enc->codec_type == CODEC_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); else if (track->enc->codec_type == CODEC_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); + } else if (track->mode == MODE_IPOD) { + tag = codec_get_tag(codec_ipod_tags, track->enc->codec_id); + if (!match_ext(s->filename, "m4a") && !match_ext(s->filename, "m4v")) + av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v " + "Quicktime/Ipod might not play the file\n"); } else if (track->mode == MODE_3GP || track->mode == MODE_3G2) { tag = codec_get_tag(codec_3gp_tags, track->enc->codec_id); } else if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL && |