On 5/19/2017 10:47 AM, Anton Khirnov wrote:
> diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
> index 2e52227..9bbec1b 100644
> --- a/libavcodec/h264_sei.c
> +++ b/libavcodec/h264_sei.c
> @@ -31,6 +31,7 @@
>  #include "h264_ps.h"
>  #include "h264_sei.h"
>  #include "internal.h"
> +#include "put_bits.h"
>  
>  static const uint8_t sei_num_clock_ts_table[9] = {
>      1, 1, 1, 2, 2, 3, 3, 2, 3
> @@ -54,21 +55,22 @@ void ff_h264_sei_uninit(H264SEIContext *h)
>      av_freep(&h->a53_caption.a53_caption);
>  }
>  
> -static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb,
> -                                 const SPS *sps, void *logctx)
> +int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS 
> *sps,
> +                                       void *logctx)
>  {
> -    if (!sps)
> -        return AVERROR_INVALIDDATA;
> +    GetBitContext gb;

GetBitContext gbc, *gb = &gbc;
init_get_bits(gb, h->payload, sizeof(h->payload));

That way you don't have to replace all the lines below.

> +
> +    init_get_bits(&gb, h->payload, sizeof(h->payload));
>  
>      if (sps->nal_hrd_parameters_present_flag ||
>          sps->vcl_hrd_parameters_present_flag) {
> -        h->cpb_removal_delay = get_bits(gb, sps->cpb_removal_delay_length);
> -        h->dpb_output_delay  = get_bits(gb, sps->dpb_output_delay_length);
> +        h->cpb_removal_delay = get_bits(&gb, sps->cpb_removal_delay_length);
> +        h->dpb_output_delay  = get_bits(&gb, sps->dpb_output_delay_length);

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to