]> git.sesse.net Git - casparcg/commitdiff
Fixed regression in streaming_consumer and ffmpeg_consumer causing PTS to be incorrect.
authorHelge Norberg <helge.norberg@svt.se>
Wed, 11 Nov 2015 18:25:56 +0000 (19:25 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 11 Nov 2015 18:25:56 +0000 (19:25 +0100)
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/consumer/streaming_consumer.cpp

index 15eaf4a29cfcdcc55589b74f1cc0c190b8ded393..716a0843e5ee33ccaf67663a1ace0d1219da132d 100644 (file)
@@ -424,8 +424,8 @@ private:
                c->codec_type           = AVMEDIA_TYPE_VIDEO;
                c->width                        = output_format_.width;
                c->height                       = output_format_.height - output_format_.croptop - output_format_.cropbot;
-               st->time_base.den       = format_desc_.time_scale;
-               st->time_base.num       = format_desc_.duration;
+               c->time_base.den        = format_desc_.time_scale;
+               c->time_base.num        = format_desc_.duration;
                c->gop_size                     = 25;
                c->flags                   |= format_desc_.field_mode == core::field_mode::progressive ? 0 : (CODEC_FLAG_INTERLACED_ME | CODEC_FLAG_INTERLACED_DCT);
                c->pix_fmt                      = c->pix_fmt != PIX_FMT_NONE ? c->pix_fmt : PIX_FMT_YUV420P;
@@ -514,8 +514,8 @@ private:
                c->sample_rate          = 48000;
                c->channels                     = 2;
                c->sample_fmt           = AV_SAMPLE_FMT_S16;
-               st->time_base.num       = 1;
-               st->time_base.den       = c->sample_rate;
+               c->time_base.num        = 1;
+               c->time_base.den        = c->sample_rate;
 
                if(output_format_.vcodec == CODEC_ID_FLV1)              
                        c->sample_rate  = 44100;                
index 0873e92495c499ff6585b082e29aa279c63f83b8..5184462247d4e79e08708983ae6b23cdeba1c6f8 100644 (file)
@@ -498,7 +498,7 @@ private:
                {
                        case AVMEDIA_TYPE_VIDEO:
                        {
-                               st->time_base                           = video_graph_out_->inputs[0]->time_base;
+                               enc->time_base                          = video_graph_out_->inputs[0]->time_base;
                                enc->pix_fmt                            = static_cast<AVPixelFormat>(video_graph_out_->inputs[0]->format);
                                enc->sample_aspect_ratio        = st->sample_aspect_ratio = video_graph_out_->inputs[0]->sample_aspect_ratio;
                                enc->width                                      = video_graph_out_->inputs[0]->w;
@@ -509,7 +509,7 @@ private:
                        }
                        case AVMEDIA_TYPE_AUDIO:
                        {
-                               st->time_base                           = audio_graph_out_->inputs[0]->time_base;
+                               enc->time_base                          = audio_graph_out_->inputs[0]->time_base;
                                enc->sample_fmt                         = static_cast<AVSampleFormat>(audio_graph_out_->inputs[0]->format);
                                enc->sample_rate                        = audio_graph_out_->inputs[0]->sample_rate;
                                enc->channel_layout                     = audio_graph_out_->inputs[0]->channel_layout;
@@ -1084,7 +1084,7 @@ private:
                                        
                if(!got_packet || pkt.size <= 0)
                        return false;
-                               
+
                pkt.stream_index = st.index;
                
                if(bsfc)