Merge commit '8411baf6f0a42bdd61f00f34aa9efec7e138b5f2'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Sep 2013 08:39:34 +0000 (10:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Sep 2013 08:39:34 +0000 (10:39 +0200)
* commit '8411baf6f0a42bdd61f00f34aa9efec7e138b5f2':
  dca_parser: Handle changes in DCA frame size

Conflicts:
libavcodec/dca_parser.c

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

@@@ -58,9 -58,14 +58,10 @@@ static int dca_find_frame_end(DCAParseC
          for (i = 0; i < buf_size; i++) {
              state = (state << 8) | buf[i];
              if (IS_MARKER(state, i, buf, buf_size)) {
 -                if (pc1->lastmarker && state == pc1->lastmarker) {
 -                    start_found = 1;
 -                    i++;
 -                    break;
 -                } else if (!pc1->lastmarker) {
 +                if (!pc1->lastmarker || state == pc1->lastmarker || pc1->lastmarker == DCA_HD_MARKER) {
                      start_found = 1;
                      pc1->lastmarker = state;
+                     i++;
                      break;
                  }
              }
              state = (state << 8) | buf[i];
              if (state == DCA_HD_MARKER && !pc1->hd_pos)
                  pc1->hd_pos = pc1->size;
 -            if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) {
 +            if (IS_MARKER(state, i, buf, buf_size) && (state == pc1->lastmarker || pc1->lastmarker == DCA_HD_MARKER)) {
                  if(pc1->framesize > pc1->size)
                      continue;
-                 // We have to check that we really read a full frame here, and that it isn't a pure HD frame, because their size is not constant.
-                 if(!pc1->framesize && state == pc1->lastmarker && state != DCA_HD_MARKER){
-                     pc1->framesize = pc1->hd_pos ? pc1->hd_pos : pc1->size;
-                 }
                  pc->frame_start_found = 0;
                  pc->state = -1;
                  pc1->size = 0;