Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-08-10 23:09:52 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-13 02:20:16 +0300
commit8009a1f1fdce16a59ea911e2b768e56ec4c8e344 (patch)
tree8ddaf0a9ba1581a07942bc39f4b91c450ccbd385 /libavformat/avisynth.c
parent1bf8f54274f8cfcea1d2ca66bb48556d40aa6396 (diff)
avisynth: fix setting stream timebase
Stream timebase should be set using avpriv_set_pts_info, otherwise avctx->pkt_timebase is not correct. This should fix ticket #4766. Patch is only compile tested. Signed-off-by: Marton Balint <cus@passwd.hu> Reviewed-by: Stephen Hutchinson <qyot27@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/avisynth.c')
-rw-r--r--libavformat/avisynth.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 7dc5ee7df6..45641c0fc1 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -237,13 +237,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->codec->width = avs->vi->width;
st->codec->height = avs->vi->height;
- st->time_base = (AVRational) { avs->vi->fps_denominator,
- avs->vi->fps_numerator };
st->avg_frame_rate = (AVRational) { avs->vi->fps_numerator,
avs->vi->fps_denominator };
st->start_time = 0;
st->duration = avs->vi->num_frames;
st->nb_frames = avs->vi->num_frames;
+ avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator);
switch (avs->vi->pixel_type) {
#ifdef USING_AVISYNTH
@@ -311,9 +310,8 @@ static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->sample_rate = avs->vi->audio_samples_per_second;
st->codec->channels = avs->vi->nchannels;
- st->time_base = (AVRational) { 1,
- avs->vi->audio_samples_per_second };
st->duration = avs->vi->num_audio_samples;
+ avpriv_set_pts_info(st, 64, 1, avs->vi->audio_samples_per_second);
switch (avs->vi->sample_type) {
case AVS_SAMPLE_INT8: