if(track->mode == MODE_MOV &&
(track->enc->codec_id == CODEC_ID_AAC ||
+ track->enc->codec_id == CODEC_ID_AC3 ||
track->enc->codec_id == CODEC_ID_AMR_NB ||
track->enc->codec_id == CODEC_ID_PCM_S24LE ||
track->enc->codec_id == CODEC_ID_PCM_S32LE ||
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)
+ else if(track->enc->codec_id == CODEC_ID_AC3)
+ mov_write_ac3_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);
{ CODEC_ID_AAC, MKTAG('m','p','4','a') },
{ CODEC_ID_AMR_NB, MKTAG('s','a','m','r') },
{ CODEC_ID_AMR_WB, MKTAG('s','a','w','b') },
+ { CODEC_ID_NONE, 0 },
};
static const AVCodecTag mov_pix_fmt_tags[] = {
{ CODEC_ID_AAC, MKTAG('m','p','4','a') },
{ CODEC_ID_ALAC, MKTAG('a','l','a','c') },
{ CODEC_ID_AC3, MKTAG('a','c','-','3') },
+ { CODEC_ID_NONE, 0 },
};
static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
put_byte(pb, strlen(compressor_name));
put_buffer(pb, compressor_name, 31);
- if (track->mode == MODE_MOV && track->enc->bits_per_sample)
- put_be16(pb, track->enc->bits_per_sample);
+ if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample)
+ put_be16(pb, track->enc->bits_per_coded_sample);
else
put_be16(pb, 0x18); /* Reserved */
put_be16(pb, 0xffff); /* Reserved */
mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 1);
mov_write_string_tag(pb, "\251cmt", s->comment , 1);
mov_write_string_tag(pb, "\251gen", s->genre , 1);
+ mov_write_string_tag(pb, "\251cpy", s->copyright , 1);
mov_write_trkn_tag(pb, mov, s);
return updateSize(pb, pos);
}
mov_write_3gp_udta_tag(pb, s, "gnre", s->genre);
mov_write_3gp_udta_tag(pb, s, "dscp", s->comment);
mov_write_3gp_udta_tag(pb, s, "albm", s->album);
+ mov_write_3gp_udta_tag(pb, s, "cprt", s->copyright);
mov_write_3gp_udta_tag(pb, s, "yrrc", "nil");
} else if (mov->mode == MODE_MOV) { // the title field breaks gtkpod with mp4 and my suspicion is that stuff is not valid in mp4
mov_write_string_tag(pb, "\251nam", s->title , 0);
mov_write_string_tag(pb, "\251enc", LIBAVFORMAT_IDENT, 0);
mov_write_string_tag(pb, "\251des", s->comment , 0);
mov_write_string_tag(pb, "\251gen", s->genre , 0);
+ mov_write_string_tag(pb, "\251cpy", s->copyright , 0);
} else {
/* iTunes meta data */
mov_write_meta_tag(pb, mov, s);
}else if(st->codec->codec_type == CODEC_TYPE_AUDIO){
track->timescale = 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);
return -1;
}else if(st->codec->frame_size > 1){ /* assume compressed audio */
track->audio_vbr = 1;
}else{
+ st->codec->frame_size = 1;
track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
}
if(track->mode != MODE_MOV &&