On Sat, May 7, 2016 at 12:35 PM, Alexandra Hájková
<[email protected]> wrote:
> ---
>  libavformat/spdifdec.c | 7 ++++---
>  libavformat/spdifenc.c | 9 +++++----
>  2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
> index 7c21235..383cd08 100644
> --- a/libavformat/spdifdec.c
> +++ b/libavformat/spdifdec.c
> @@ -29,6 +29,7 @@
>  #include "spdif.h"
>  #include "libavcodec/ac3.h"
>  #include "libavcodec/aacadtsdec.h"
> +#include "libavcodec/bitstream.h"
>
>  static int spdif_get_offset_and_codec(AVFormatContext *s,
>                                        enum IEC61937DataType data_type,
> @@ -36,7 +37,7 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
>                                        enum AVCodecID *codec)
>  {
>      AACADTSHeaderInfo aac_hdr;
> -    GetBitContext gbc;
> +    BitstreamContext bcc;
>
>      switch (data_type & 0xff) {
>      case IEC61937_AC3:
> @@ -56,8 +57,8 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
>          *codec = AV_CODEC_ID_MP3;
>          break;
>      case IEC61937_MPEG2_AAC:
> -        init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
> -        if (avpriv_aac_parse_header(&gbc, &aac_hdr)) {
> +        bitstream_init(&bcc, buf, AAC_ADTS_HEADER_SIZE * 8);

This should use bitstream_init8 much more consistenly everwhere where
there is a * 8 multiplication in the arguments, IMHO.

> +        if (avpriv_aac_parse_header(&bcc, &aac_hdr)) {
>              if (s) /* be silent during a probe */
>                  av_log(s, AV_LOG_ERROR, "Invalid AAC packet in IEC 61937\n");
>              return AVERROR_INVALIDDATA;
> diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
> index a19bcab..642c140 100644
> --- a/libavformat/spdifenc.c
> +++ b/libavformat/spdifenc.c
> @@ -50,9 +50,10 @@
>  #include "avio_internal.h"
>  #include "spdif.h"
>  #include "libavcodec/ac3.h"
> +#include "libavcodec/bitstream.h"
>  #include "libavcodec/dca.h"
>  #include "libavcodec/dca_syncwords.h"
> -#include "libavcodec/aacadtsdec.h"
> +#include "libavcodec/aacpickadtsdec.h"
>  #include "libavutil/opt.h"
>
>  typedef struct IEC61937Context {
> @@ -350,11 +351,11 @@ static int spdif_header_aac(AVFormatContext *s, 
> AVPacket *pkt)
>  {
>      IEC61937Context *ctx = s->priv_data;
>      AACADTSHeaderInfo hdr;
> -    GetBitContext gbc;
> +    BitstreamContext bcc;
>      int ret;
>
> -    init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
> -    ret = avpriv_aac_parse_header(&gbc, &hdr);
> +    bitstream_init(&bcc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
> +    ret = avpriv_aac_parse_header(&bcc, &hdr);
>      if (ret < 0) {
>          av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");
>          return AVERROR_INVALIDDATA;
> --
> 2.1.4
>
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to