~ubuntu-branches/ubuntu/utopic/libav/utopic-proposed

« back to all changes in this revision

Viewing changes to libavcodec/wmaprodec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Reinhard Tartler, Rico Tzschichholz
  • Date: 2014-08-30 11:02:45 UTC
  • mfrom: (1.3.47 sid)
  • Revision ID: package-import@ubuntu.com-20140830110245-io3dg7q85wfr7125
Tags: 6:11~beta1-2
[ Reinhard Tartler ]
* Make libavcodec-dev depend on libavresample-dev

[ Rico Tzschichholz ]
* Some fixes and leftovers from soname bumps

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
 * subframe in order to reconstruct the output samples.
87
87
 */
88
88
 
 
89
#include <inttypes.h>
 
90
 
89
91
#include "libavutil/float_dsp.h"
90
92
#include "libavutil/intfloat.h"
91
93
#include "libavutil/intreadwrite.h"
237
239
static av_cold void dump_context(WMAProDecodeCtx *s)
238
240
{
239
241
#define PRINT(a, b)     av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);
240
 
#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %x\n", a, b);
 
242
#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %"PRIx32"\n", a, b);
241
243
 
242
244
    PRINT("ed sample bit depth", s->bits_per_sample);
243
245
    PRINT_HEX("ed decode flags", s->decode_flags);
332
334
    s->dynamic_range_compression = (s->decode_flags & 0x80);
333
335
 
334
336
    if (s->max_num_subframes > MAX_SUBFRAMES) {
335
 
        av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
 
337
        av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %"PRId8"\n",
336
338
               s->max_num_subframes);
337
339
        return AVERROR_INVALIDDATA;
338
340
    }
339
341
 
340
342
    if (s->min_samples_per_subframe < WMAPRO_BLOCK_MIN_SIZE) {
341
 
        av_log(avctx, AV_LOG_ERROR, "Invalid minimum block size %i\n",
 
343
        av_log(avctx, AV_LOG_ERROR, "Invalid minimum block size %"PRId8"\n",
342
344
               s->max_num_subframes);
343
345
        return AVERROR_INVALIDDATA;
344
346
    }
1408
1410
        if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
1409
1411
            /** FIXME: not sure if this is always an error */
1410
1412
            av_log(s->avctx, AV_LOG_ERROR,
1411
 
                   "frame[%i] would have to skip %i bits\n", s->frame_num,
 
1413
                   "frame[%"PRIu32"] would have to skip %i bits\n",
 
1414
                   s->frame_num,
1412
1415
                   len - (get_bits_count(gb) - s->frame_offset) - 1);
1413
1416
            s->packet_loss = 1;
1414
1417
            return 0;
1546
1549
        if (!s->packet_loss &&
1547
1550
            ((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
1548
1551
            s->packet_loss = 1;
1549
 
            av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
 
1552
            av_log(avctx, AV_LOG_ERROR,
 
1553
                   "Packet loss detected! seq %"PRIx8" vs %x\n",
1550
1554
                   s->packet_sequence_number, packet_sequence_number);
1551
1555
        }
1552
1556
        s->packet_sequence_number = packet_sequence_number;