Merge commit '8747926'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Nov 2014 09:50:59 +0000 (10:50 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Nov 2014 09:50:59 +0000 (10:50 +0100)
* commit '8747926':
  vorbis_parser: use a dedicated AVClass for logging

Conflicts:
libavcodec/vorbis_parser.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/vorbis_parser.c
libavcodec/vorbis_parser.h

@@@ -211,23 -219,7 +219,23 @@@ int avpriv_vorbis_parse_frame_flags(Vor
          int previous_blocksize = s->previous_blocksize;
  
          if (buf[0] & 1) {
-             av_log(s->avctx, AV_LOG_ERROR, "Invalid packet\n");
 +            /* If the user doesn't care about special packets, it's a bad one. */
 +            if (!flags)
 +                goto bad_packet;
 +
 +            /* Set the flag for which kind of special packet it is. */
 +            if (buf[0] == 1)
 +                *flags |= VORBIS_FLAG_HEADER;
 +            else if (buf[0] == 3)
 +                *flags |= VORBIS_FLAG_COMMENT;
 +            else
 +                goto bad_packet;
 +
 +            /* Special packets have no duration. */
 +            return 0;
 +
 +bad_packet:
+             av_log(s, AV_LOG_ERROR, "Invalid packet\n");
              return AVERROR_INVALIDDATA;
          }
          if (s->mode_count == 1)
          else
              mode = (buf[0] & s->mode_mask) >> 1;
          if (mode >= s->mode_count) {
-             av_log(s->avctx, AV_LOG_ERROR, "Invalid mode in packet\n");
+             av_log(s, AV_LOG_ERROR, "Invalid mode in packet\n");
              return AVERROR_INVALIDDATA;
          }
 -        if (mode) {
 +        if(s->mode_blocksize[mode]){
              int flag = !!(buf[0] & s->prev_mask);
              previous_blocksize = s->blocksize[flag];
          }
Simple merge