Merge commit '8bcadaacc2b8dc3c5d6569835a5ca20e62d3efca'
authorHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 12:55:39 +0000 (13:55 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 12:55:39 +0000 (13:55 +0100)
* commit '8bcadaacc2b8dc3c5d6569835a5ca20e62d3efca':
  mpegenc: use the CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavformat/mpegenc.c

@@@ -389,13 -385,13 +391,15 @@@ static av_cold int mpeg_mux_init(AVForm
                  stream->id = h264_id++;
              else
                  stream->id = mpv_id++;
-             if (st->codec->rc_buffer_size)
-                 stream->max_buffer_size = 6 * 1024 + st->codec->rc_buffer_size / 8;
+             props = (AVCPBProperties*)av_stream_get_side_data(st, AV_PKT_DATA_CPB_PROPERTIES, NULL);
+             if (props && props->buffer_size)
+                 stream->max_buffer_size = 6 * 1024 + props->buffer_size / 8;
              else {
                  av_log(ctx, AV_LOG_WARNING,
 -                       "VBV buffer size not set, muxing may fail\n");
 +                       "VBV buffer size not set, using default size of 130KB\n"
 +                       "If you want the mpeg file to be compliant to some specification\n"
 +                       "Like DVD, VCD or others, make sure you set the correct buffer size\n");
                  // FIXME: this is probably too small as default
                  stream->max_buffer_size = 230 * 1024;
              }