Browse code

DCA frame size is constant

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

Kostya Shishkov authored on 2008/04/15 22:36:56
Showing 1 changed files
... ...
@@ -32,6 +32,8 @@
32 32
 typedef struct DCAParseContext {
33 33
     ParseContext pc;
34 34
     uint32_t lastmarker;
35
+    int size;
36
+    int framesize;
35 37
 } DCAParseContext;
36 38
 
37 39
 #define IS_MARKER(state, i, buf, buf_size) \
... ...
@@ -71,10 +73,13 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf,
71 71
     }
72 72
     if (start_found) {
73 73
         for (; i < buf_size; i++) {
74
+            pc1->size++;
74 75
             state = (state << 8) | buf[i];
75
-            if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) {
76
+            if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size) && (!pc1->framesize || pc1->framesize == pc1->size)) {
76 77
                 pc->frame_start_found = 0;
77 78
                 pc->state = -1;
79
+                pc1->framesize = pc1->size;
80
+                pc1->size = 0;
78 81
                 return i - 3;
79 82
             }
80 83
         }