[vlc-commits] avformat: set stream time_base and not codec

Ilkka Ollakka git at videolan.org
Wed Oct 21 19:13:34 CEST 2015


vlc/vlc-2.2 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Aug  9 00:39:49 2015 +0300| [819e16b47904d0781b722d7b8a80efd23da74409] | committer: Jean-Baptiste Kempf

avformat: set stream time_base and not codec

(cherry picked from commit 74e427d4b7d9bf5ccd9ceecc9b7937a4b3cbf372)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=819e16b47904d0781b722d7b8a80efd23da74409
---

 modules/demux/avformat/mux.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index 9b2d98c..21e95b8 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -228,7 +228,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
         codec->codec_type = AVMEDIA_TYPE_AUDIO;
         codec->channels = fmt->audio.i_channels;
         codec->sample_rate = fmt->audio.i_rate;
-        codec->time_base = (AVRational){1, codec->sample_rate};
+        stream->time_base = (AVRational){1, codec->sample_rate};
         codec->frame_size = fmt->audio.i_frame_length;
         if (fmt->i_bitrate == 0) {
             msg_Warn( p_mux, "Missing audio bitrate, assuming 64k" );
@@ -258,8 +258,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
                 fmt->video.i_sar_num, fmt->video.i_sar_den);
         stream->sample_aspect_ratio.den = codec->sample_aspect_ratio.den;
         stream->sample_aspect_ratio.num = codec->sample_aspect_ratio.num;
-        codec->time_base.den = fmt->video.i_frame_rate;
-        codec->time_base.num = fmt->video.i_frame_rate_base;
+        stream->time_base.den = fmt->video.i_frame_rate;
+        stream->time_base.num = fmt->video.i_frame_rate_base;
         if (fmt->i_bitrate == 0) {
             msg_Warn( p_mux, "Missing video bitrate, assuming 512k" );
             fmt->i_bitrate = 512000;



More information about the vlc-commits mailing list