]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/shorten.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavcodec / shorten.c
index 7f8ef819c003fd8c3b2a1020d285c7a23ce4a078..328aaccd29828b1c5a470c0687abc992092ebb73 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /**
- * @file shorten.c
+ * @file libavcodec/shorten.c
  * Shorten decoder
  * @author Jeff Muizelaar
  *
@@ -29,7 +29,7 @@
 #define DEBUG
 #include <limits.h>
 #include "avcodec.h"
-#include "bitstream.h"
+#include "get_bits.h"
 #include "golomb.h"
 
 #define MAX_CHANNELS 8
@@ -228,9 +228,9 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header
     avctx->sample_rate = get_le32(&hb);
     avctx->bit_rate = get_le32(&hb) * 8;
     avctx->block_align = get_le16(&hb);
-    avctx->bits_per_sample = get_le16(&hb);
+    avctx->bits_per_coded_sample = get_le16(&hb);
 
-    if (avctx->bits_per_sample != 16) {
+    if (avctx->bits_per_coded_sample != 16) {
         av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n");
         return -1;
     }
@@ -269,8 +269,10 @@ static void decode_subframe_lpc(ShortenContext *s, int channel, int residual_siz
 
 static int shorten_decode_frame(AVCodecContext *avctx,
         void *data, int *data_size,
-        const uint8_t *buf, int buf_size)
+        AVPacket *avpkt)
 {
+    const uint8_t *buf = avpkt->data;
+    int buf_size = avpkt->size;
     ShortenContext *s = avctx->priv_data;
     int i, input_buf_size = 0;
     int16_t *samples = data;
@@ -305,7 +307,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
     {
         int maxnlpc = 0;
         /* shorten signature */
-        if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
+        if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) {
             av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
             return -1;
         }