Commit dc878b96 authored by Alex Converse's avatar Alex Converse

movenc: Support high sample rates in isomedia formats by setting the sample...

movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0.

Libisomediafile appears to always set this field to zero.
parent f973a85d
......@@ -630,7 +630,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
avio_wb16(pb, 0);
avio_wb16(pb, 0); /* packet size (= 0) */
avio_wb16(pb, track->enc->sample_rate);
avio_wb16(pb, track->enc->sample_rate <= UINT16_MAX ?
track->enc->sample_rate : 0);
avio_wb16(pb, 0); /* Reserved */
}
......@@ -3122,18 +3123,12 @@ static int mov_write_header(AVFormatContext *s)
if (av_get_bits_per_sample(st->codec->codec_id) < 8) {
track->audio_vbr = 1;
}
if (track->mode != MODE_MOV) {
if (track->timescale > UINT16_MAX) {
av_log(s, AV_LOG_ERROR, "track %d: output format does not support "
"sample rate %dhz\n", i, track->timescale);
goto error;
}
if (track->enc->codec_id == CODEC_ID_MP3 && track->timescale < 16000) {
if (track->mode != MODE_MOV &&
track->enc->codec_id == CODEC_ID_MP3 && track->timescale < 16000) {
av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n",
i, track->enc->sample_rate);
goto error;
}
}
}else if(st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE){
track->timescale = st->codec->time_base.den;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment