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 55c7e523e9..bb515747ad 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -907,10 +907,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");
@@ -3057,10 +3057,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);
@@ -4028,7 +4030,7 @@ static int mov_write_header(AVFormatContext *s)
if (mov->video_track_timescale) {
track->timescale = mov->video_track_timescale;
} else {
- track->timescale = st->codec->time_base.den;
+ track->timescale = st->time_base.den;
while(track->timescale < 10000)
track->timescale *= 2;
}
@@ -4068,9 +4070,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;
} else {
track->timescale = MOV_TIMESCALE;
}