On czwartek, 27 marca 2008, Michael Niedermayer wrote:
> > >  You do this in stream_type but this name is totally wrong this is not
> > > a stream_type. It is not even constant for a stream. NEVER even think
> > > of using a name from the a52* spec, the people who wrote it are idiots.
> > > Its a flag indicating the start/end of a frame. And IMHO it should be
> > > returned more directly than as a context variable but thats rather
> > > minor the name is a major issue. It totally confused me until looked it
> > > up in the spec.
[...]
> > 2.change of stream_type to frame_type

According to your suggestion, I changed name of stream type  to frame type. 
Should correction of type of frame_type from uint8_t to EAC3FrameType be in 
separate patch?

-- 
Bartlomiej Wolowiec
Index: libavcodec/ac3dec.c
===================================================================
--- libavcodec/ac3dec.c	(wersja 12621)
+++ libavcodec/ac3dec.c	(kopia robocza)
@@ -1169,7 +1169,7 @@
             case AC3_PARSE_ERROR_FRAME_SIZE:
                 av_log(avctx, AV_LOG_ERROR, "invalid frame size\n");
                 break;
-            case AC3_PARSE_ERROR_STREAM_TYPE:
+            case AC3_PARSE_ERROR_FRAME_TYPE:
                 av_log(avctx, AV_LOG_ERROR, "invalid stream type\n");
                 break;
             default:
Index: libavcodec/ac3_parser.c
===================================================================
--- libavcodec/ac3_parser.c	(wersja 12622)
+++ libavcodec/ac3_parser.c	(kopia robocza)
@@ -84,13 +84,13 @@
         hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
         hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
         hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
-        hdr->stream_type = EAC3_STREAM_TYPE_INDEPENDENT;
+        hdr->frame_type = EAC3_FRAME_TYPE_INDEPENDENT;
     } else {
         /* Enhanced AC-3 */
         hdr->crc1 = 0;
-        hdr->stream_type = get_bits(&gbc, 2);
-        if(hdr->stream_type == EAC3_STREAM_TYPE_RESERVED)
-            return AC3_PARSE_ERROR_STREAM_TYPE;
+        hdr->frame_type = get_bits(&gbc, 2);
+        if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
+            return AC3_PARSE_ERROR_FRAME_TYPE;
 
         skip_bits(&gbc, 3); // skip substream id
 
@@ -138,14 +138,14 @@
     hdr_info->channels = hdr.channels;
     hdr_info->samples = AC3_FRAME_SIZE;
 
-    switch(hdr.stream_type){
-        case EAC3_STREAM_TYPE_INDEPENDENT:
+    switch(hdr.frame_type){
+        case EAC3_FRAME_TYPE_INDEPENDENT:
             *flag = FRAME_START;
             break;
-        case EAC3_STREAM_TYPE_DEPENDENT:
+        case EAC3_FRAME_TYPE_DEPENDENT:
             *flag = FRAME_CONTINUATION;
             break;
-        case EAC3_STREAM_TYPE_AC3_CONVERT:
+        case EAC3_FRAME_TYPE_AC3_CONVERT:
             *flag = FRAME_COMPLETE;
             break;
     }
Index: libavcodec/ac3_parser.h
===================================================================
--- libavcodec/ac3_parser.h	(wersja 12621)
+++ libavcodec/ac3_parser.h	(kopia robocza)
@@ -30,7 +30,7 @@
     AC3_PARSE_ERROR_BSID        = -2,
     AC3_PARSE_ERROR_SAMPLE_RATE = -3,
     AC3_PARSE_ERROR_FRAME_SIZE  = -4,
-    AC3_PARSE_ERROR_STREAM_TYPE = -5,
+    AC3_PARSE_ERROR_FRAME_TYPE  = -5,
 } AC3ParseError;
 
 /**
Index: libavcodec/ac3.h
===================================================================
--- libavcodec/ac3.h	(wersja 12621)
+++ libavcodec/ac3.h	(kopia robocza)
@@ -84,7 +84,7 @@
     uint8_t bitstream_id;
     uint8_t channel_mode;
     uint8_t lfe_on;
-    uint8_t stream_type;
+    uint8_t frame_type;
     /** @} */
 
     /** @defgroup derived Derived values
@@ -99,11 +99,11 @@
 } AC3HeaderInfo;
 
 typedef enum {
-    EAC3_STREAM_TYPE_INDEPENDENT = 0,
-    EAC3_STREAM_TYPE_DEPENDENT,
-    EAC3_STREAM_TYPE_AC3_CONVERT,
-    EAC3_STREAM_TYPE_RESERVED
-} EAC3StreamType;
+    EAC3_FRAME_TYPE_INDEPENDENT = 0,
+    EAC3_FRAME_TYPE_DEPENDENT,
+    EAC3_FRAME_TYPE_AC3_CONVERT,
+    EAC3_FRAME_TYPE_RESERVED
+} EAC3FrameType;
 
 void ac3_common_init(void);
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to