Ignore:
Timestamp:
11/23/06 19:17:14 (17 years ago)
Author:
r2d
Message:
  • merged SI and RG blocks
  • updated seek table according to the spec in mppenc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/mppenc/mppenc.c

    r147 r149  
    16311631
    16321632        e.MS_Channelmode = m.MS_Channelmode;
     1633        e.seek_ref = ftell(e.outputFile);
    16331634        writeMagic(&e);
    16341635        writeStreamInfo ( &e, m.Max_Band, m.MS_Channelmode > 0, SamplesInWAVE,
    16351636                                           m.SampleFreq, Wave.Channels > 2 ? 2 : Wave.Channels);
    16361637        writeBlock(&e, "SI", TRUE);
    1637         writeGainInfo(&e);
    1638         writeBlock(&e, "RG", FALSE);
    16391638        writeEncoderInfo(&e, m.MainQual, m.PNS > 0, MPPENC_MAJOR, MPPENC_MINOR,
    16401639                                          MPPENC_IMPLEMENT, MPPENC_BUILD);
    16411640        writeBlock(&e, "EI", FALSE);
    1642         e.seek_ref = ftell(e.outputFile);
    1643         writeBits (&e, 0, 32); // jump 32 bits for seek table pointer
    1644         writeBlock(&e, "ST", FALSE); // reserve space for pointer
     1641        e.seek_ptr = ftell(e.outputFile);
     1642        writeBits (&e, 0, 8);
     1643        writeBits (&e, 0, 32); // jump 40 bits for seek table pointer
     1644        writeBlock(&e, "SP", FALSE); // reserve space for seek pointer
    16451645
    16461646
     
    17431743
    17441744    // write the last incomplete block
    1745         e.seek_table[e.seek_pos] = ftell(e.outputFile);
    1746         e.seek_pos++;
     1745        if ((e.block_cnt & ((1 << e.seek_pwr) - 1)) == 0) {
     1746                e.seek_table[e.seek_pos] = ftell(e.outputFile);
     1747                e.seek_pos++;
     1748        }
    17471749        writeBlock(&e, "AD", FALSE);
    17481750        writeSeekTable(&e);
Note: See TracChangeset for help on using the changeset viewer.