removal of stream_type in AACAC3ParseContext and adding AACAC3FrameFlag
[ffmpeg.git] / libavcodec / ac3_parser.c
index 7f0818b..ea7f592 100644 (file)
@@ -123,7 +123,7 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr)
     return 0;
 }
 
-static int ac3_sync(AACAC3ParseContext *hdr_info)
+static int ac3_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag)
 {
     int err;
     AC3HeaderInfo hdr;
@@ -137,6 +137,18 @@ static int ac3_sync(AACAC3ParseContext *hdr_info)
     hdr_info->bit_rate = hdr.bit_rate;
     hdr_info->channels = hdr.channels;
     hdr_info->samples = AC3_FRAME_SIZE;
+
+    switch(hdr.stream_type){
+        case EAC3_STREAM_TYPE_INDEPENDENT:
+            *flag = FRAME_START;
+            break;
+        case EAC3_STREAM_TYPE_DEPENDENT:
+            *flag = FRAME_CONTINUATION;
+            break;
+        case EAC3_STREAM_TYPE_AC3_CONVERT:
+            *flag = FRAME_COMPLETE;
+            break;
+    }
     return hdr.frame_size;
 }