[FFmpeg-cvslog] dca_parser: Add support for parsing dts express

Hendrik Leppkes git at videolan.org
Fri Oct 28 15:33:32 CEST 2011


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Fri May 27 16:14:48 2011 +0200| [14474fbbd0dd85bfea612e5fc8c6e42b086ba910] | committer: Michael Niedermayer

dca_parser: Add support for parsing dts express
(cherry picked from commit ea36f60493f675db531dc2dbef04fb60fbc21a6a)

Review-by: Benjamin Larsson
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14474fbbd0dd85bfea612e5fc8c6e42b086ba910
---

 libavcodec/dca_parser.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index a956e75..ff91769 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -36,7 +36,7 @@ typedef struct DCAParseContext {
 #define IS_MARKER(state, i, buf, buf_size) \
  ((state == DCA_MARKER_14B_LE && (i < buf_size-2) && (buf[i+1] & 0xF0) == 0xF0 && buf[i+2] == 0x07) \
  || (state == DCA_MARKER_14B_BE && (i < buf_size-2) && buf[i+1] == 0x07 && (buf[i+2] & 0xF0) == 0xF0) \
- || state == DCA_MARKER_RAW_LE || state == DCA_MARKER_RAW_BE)
+ || state == DCA_MARKER_RAW_LE || state == DCA_MARKER_RAW_BE || state == DCA_HD_MARKER)
 
 /**
  * finds the end of the current frame in the bitstream.
@@ -57,10 +57,7 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf,
         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;
-                    break;
-                } else if (!pc1->lastmarker) {
+                if (!pc1->lastmarker || state == pc1->lastmarker || pc1->lastmarker == DCA_HD_MARKER) {
                     start_found = 1;
                     pc1->lastmarker = state;
                     break;
@@ -74,7 +71,7 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf,
             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;
                 if(!pc1->framesize){



More information about the ffmpeg-cvslog mailing list