Browse code

Use proper bytestream functions

Originally committed as revision 9580 to svn://svn.ffmpeg.org/ffmpeg/trunk

Vitor Sessak authored on 2007/07/11 02:50:44
Showing 1 changed files
... ...
@@ -55,6 +55,7 @@
55 55
 
56 56
 #include "avcodec.h"
57 57
 #include "bitstream.h"
58
+#include "bytestream.h"
58 59
 
59 60
 #define ALAC_EXTRADATA_SIZE 36
60 61
 #define MAX_CHANNELS 2
... ...
@@ -116,22 +117,22 @@ static int alac_set_info(ALACContext *alac)
116 116
         av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");
117 117
         return -1;
118 118
     }
119
-    alac->setinfo_max_samples_per_frame = AV_RB32(ptr); /* buffer size / 2 ? */
120
-    ptr += 4;
119
+
120
+    /* buffer size / 2 ? */
121
+    alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);
121 122
     alac->setinfo_7a = *ptr++;
122 123
     alac->setinfo_sample_size = *ptr++;
123 124
     alac->setinfo_rice_historymult = *ptr++;
124 125
     alac->setinfo_rice_initialhistory = *ptr++;
125 126
     alac->setinfo_rice_kmodifier = *ptr++;
126 127
     alac->setinfo_7f = *ptr++; // channels?
127
-    alac->setinfo_80 = AV_RB16(ptr);
128
-    ptr += 2;
129
-    alac->setinfo_82 = AV_RB32(ptr); // max coded frame size
130
-    ptr += 4;
131
-    alac->setinfo_86 = AV_RB32(ptr); // bitrate ?
132
-    ptr += 4;
133
-    alac->setinfo_8a_rate = AV_RB32(ptr); // samplerate
134
-    ptr += 4;
128
+    alac->setinfo_80                    = bytestream_get_be16(&ptr);
129
+    /* max coded frame size */
130
+    alac->setinfo_82                    = bytestream_get_be32(&ptr);
131
+    /* bitrate ? */
132
+    alac->setinfo_86                    = bytestream_get_be32(&ptr);
133
+    /* samplerate */
134
+    alac->setinfo_8a_rate               = bytestream_get_be32(&ptr);
135 135
 
136 136
     allocate_buffers(alac);
137 137