summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-21 22:56:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-21 22:56:07 +0200
commitc047afb80c7373c8533f5aeff6413015a814faaf (patch)
treeb1f31e060532f10412fb8a1d87582d61c1ee1e67 /libavformat/movenc.c
parent2f06b56382ddd4ae1bbe09fd07f6e7658bfece08 (diff)
parent95510be8c35753da8f48062b28b65e7acdab965f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avcodec: remove AVCodecContext.dsp_mask avconv: fix a segfault when default encoder for a format doesn't exist. utvideo: general cosmetics aac: Handle HE-AACv2 when sniffing a channel order. movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0. xxan: Remove write-only variable in xan_decode_frame_type0(). ivi_common: Initialize a variable at declaration in ff_ivi_decode_blocks(). Conflicts: ffmpeg.c libavcodec/utvideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c99e854b25..8dc6ada831 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -661,7 +661,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
}
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 */
}
@@ -3199,17 +3200,11 @@ static int mov_write_header(AVFormatContext *s)
}else{
track->sample_size = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
}
- 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) {
- av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n",
- i, track->enc->sample_rate);
- goto error;
- }
+ 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;