]> granicus.if.org Git - handbrake/commitdiff
muxavformat: Inform muxer of encoder delay
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 15 Feb 2017 22:47:49 +0000 (15:47 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 15 Feb 2017 22:47:49 +0000 (15:47 -0700)
initial_padding is used to inform libav muxers of initial encoder delay
duration.  When set for mkv it can be used to remove the silence samples
during playback since the delay value gets stored in the mkv CodecDelay
element.

libhb/muxavformat.c

index 729e6c6721a0514dee868e52095712208f6d443e..6c56f8a5f7573f80103d8ac967dd4592e5fa7ca1 100644 (file)
@@ -401,6 +401,8 @@ static int avformatInit( hb_mux_object_t * m )
         }
 
         track->st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+        track->st->codecpar->initial_padding = audio->priv.config.init_delay *
+                                        audio->config.out.samplerate / 90000;
         if (job->mux == HB_MUX_AV_MP4)
         {
             track->st->time_base.num = 1;