]> git.sesse.net Git - ffmpeg/commitdiff
get substreamid from ac3 parser
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 7 Jun 2008 22:29:11 +0000 (22:29 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 7 Jun 2008 22:29:11 +0000 (22:29 +0000)
Originally committed as revision 13689 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/ac3.h
libavcodec/ac3_parser.c
libavcodec/ac3dec.c

index a7c48ebc23eba9fda2e8452186bc4fb47bcda37a..abe40a5617479ed6d79ea95eeaacaf91b3add2aa 100644 (file)
@@ -85,6 +85,7 @@ typedef struct {
     uint8_t channel_mode;
     uint8_t lfe_on;
     uint8_t frame_type;
+    int substreamid;                        ///< substream identification
     int center_mix_level;                   ///< Center mix level index
     int surround_mix_level;                 ///< Surround mix level index
     uint16_t channel_map;
index 667c6d3821a7c8889ede8d17cd5e5fe4f16616f7..7e6bea14c9dfdcf54e9e53c9d0bb07b425c28683 100644 (file)
@@ -99,6 +99,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
         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->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT;
+        hdr->substreamid = 0;
     } else {
         /* Enhanced AC-3 */
         hdr->crc1 = 0;
@@ -106,7 +107,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
         if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
             return AC3_PARSE_ERROR_FRAME_TYPE;
 
-        skip_bits(gbc, 3); // skip substream id
+        hdr->substreamid = get_bits(gbc, 3);
 
         hdr->frame_size = (get_bits(gbc, 11) + 1) << 1;
         if(hdr->frame_size < AC3_HEADER_SIZE)
index ad5e0831f0e6e501b0ffb7cdf619494136aa3432..94c98ac10286804d41dd21d1963a312feaa15bf3 100644 (file)
@@ -134,6 +134,7 @@ typedef struct {
 
     int sample_rate;                        ///< sample frequency, in Hz
     int bit_rate;                           ///< stream bit rate, in bits-per-second
+    int substreamid;                        ///< substream identification
     int frame_size;                         ///< current frame size, in bytes
 
     int channels;                           ///< number of total channels
@@ -326,6 +327,7 @@ static int ac3_parse_header(AC3DecodeContext *s)
     s->center_mix_level             = hdr.center_mix_level;
     s->surround_mix_level           = hdr.surround_mix_level;
     s->num_blocks                   = hdr.num_blocks;
+    s->substreamid                  = hdr.substreamid;
 
     if(s->lfe_on) {
         s->start_freq[s->lfe_ch] = 0;