On Wed, Jan 15, 2020 at 12:42:13AM +0100, Nicolas Gaullier wrote:
> This fixes mpeg2video stream copies to mpeg muxer like this:
>   ffmpeg -i xdcamhd.mxf -c:v copy output.mpg
> ---
>  libavcodec/mpeg12dec.c       | 7 +++++++
>  tests/ref/fate/mxf-probe-d10 | 3 +++
>  tests/ref/fate/ts-demux      | 2 +-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index 17f9495a1d..48ac14fafa 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -1398,6 +1398,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context 
> *s1)
>      MpegEncContext *s = &s1->mpeg_enc_ctx;
>      int horiz_size_ext, vert_size_ext;
>      int bit_rate_ext;
> +    AVCPBProperties *cpb_props;
>  
>      skip_bits(&s->gb, 1); /* profile and level esc*/
>      s->avctx->profile       = get_bits(&s->gb, 3);
> @@ -1429,6 +1430,12 @@ static void 
> mpeg_decode_sequence_extension(Mpeg1Context *s1)
>      ff_dlog(s->avctx, "sequence extension\n");
>      s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
>  
> +    if (cpb_props = ff_add_cpb_side_data(s->avctx)) {
> +        cpb_props->buffer_size = FFMAX(cpb_props->buffer_size, 
> s->avctx->rc_buffer_size);
> +        if (s->bit_rate != 0x3FFFF*400)
> +            cpb_props->max_bitrate = FFMAX(cpb_props->max_bitrate, 
> s->bit_rate);
> +    }

why does this not export exactly the numbers as read from the header?

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to