summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index dcd3294e01..f5c36fcec1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -814,10 +814,10 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track)
else if (track->enc->pix_fmt == AV_PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p');
else tag = MKTAG('d','v','p','p');
else if (track->enc->height == 720) /* HD 720 line */
- if (track->enc->time_base.den == 50) tag = MKTAG('d','v','h','q');
+ if (track->st->time_base.den == 50) tag = MKTAG('d','v','h','q');
else tag = MKTAG('d','v','h','p');
else if (track->enc->height == 1080) /* HD 1080 line */
- if (track->enc->time_base.den == 25) tag = MKTAG('d','v','h','5');
+ if (track->st->time_base.den == 25) tag = MKTAG('d','v','h','5');
else tag = MKTAG('d','v','h','6');
else {
av_log(s, AV_LOG_ERROR, "unsupported height for dv codec\n");
@@ -2656,10 +2656,12 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
{
+ AVStream *video_st = s->streams[0];
AVCodecContext *video_codec = s->streams[0]->codec;
AVCodecContext *audio_codec = s->streams[1]->codec;
int audio_rate = audio_codec->sample_rate;
- int frame_rate = ((video_codec->time_base.den) * (0x10000)) / (video_codec->time_base.num);
+ // TODO: should be avg_frame_rate
+ int frame_rate = ((video_st->time_base.den) * (0x10000)) / (video_st->time_base.num);
int audio_kbitrate = audio_codec->bit_rate / 1000;
int video_kbitrate = FFMIN(video_codec->bit_rate / 1000, 800 - audio_kbitrate);
@@ -3400,7 +3402,7 @@ static int mov_write_header(AVFormatContext *s)
}
track->height = track->tag >> 24 == 'n' ? 486 : 576;
}
- track->timescale = st->codec->time_base.den;
+ track->timescale = st->time_base.den;
if (track->mode == MODE_MOV && track->timescale > 100000)
av_log(s, AV_LOG_WARNING,
"WARNING codec timebase is very high. If duration is too long,\n"
@@ -3428,9 +3430,9 @@ static int mov_write_header(AVFormatContext *s)
goto error;
}
} else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- track->timescale = st->codec->time_base.den;
+ track->timescale = st->time_base.den;
} else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) {
- track->timescale = st->codec->time_base.den;
+ track->timescale = st->time_base.den;
}
if (!track->height)
track->height = st->codec->height;