Changeset 213
- Timestamp:
- 02/13/07 12:13:51 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/mpcenc/mpcenc.c
r212 r213 1514 1514 PsyModel m; 1515 1515 mpc_encoder_t e; 1516 mpc_uint_t si_size; 1516 1517 1517 1518 // initialize tables which must be initialized once and only once … … 1611 1612 writeStreamInfo ( &e, m.Max_Band, m.MS_Channelmode > 0, SamplesInWAVE, 1612 1613 m.SampleFreq, Wave.Channels > 2 ? 2 : Wave.Channels, 0, 0, 0, 0); 1613 writeBlock(&e, "SI", MPC_TRUE, 0);1614 si_size = writeBlock(&e, "SI", MPC_TRUE, 0); 1614 1615 writeEncoderInfo(&e, m.FullQual, m.PNS > 0, MPPENC_MAJOR, MPPENC_MINOR, 1615 1616 MPPENC_IMPLEMENT, MPPENC_BUILD); … … 1642 1643 if ( myfeof (Wave.fp) ) { 1643 1644 stderr_printf ( "WAVE file has incorrect header: header: %.3f s, contents: %.3f s \n", 1644 (long double)(AllSamplesRead) / m.SampleFreq, (long double)(SamplesInWAVE) / m.SampleFreq ); 1645 SamplesInWAVE = AllSamplesRead; 1645 (long double)(SamplesInWAVE) / m.SampleFreq, (long double)(AllSamplesRead) / m.SampleFreq); 1646 1646 } 1647 1647 … … 1712 1712 // adapt SamplesInWAV to the real number of contained samples 1713 1713 if ( myfeof (Wave.fp) ) { 1714 stderr_printf ( "WAVE file has incorrect header: header: %.3f s, contents: %.3f s \n", 1715 (long double)(AllSamplesRead) / m.SampleFreq, (long double)(SamplesInWAVE) / m.SampleFreq ); 1716 SamplesInWAVE = AllSamplesRead; 1714 stderr_printf ( "WAVE file has incorrect header: header: %.3f s, contents: %.3f s \n", 1715 (long double)(SamplesInWAVE) / m.SampleFreq, (long double)(AllSamplesRead) / m.SampleFreq); 1717 1716 } 1718 1717 } … … 1730 1729 writeBlock(&e, "ST", MPC_FALSE, 0); // write seek table block 1731 1730 writeBlock(&e, "SE", MPC_FALSE, 0); // write end of stream block 1731 1732 if (SamplesInWAVE != AllSamplesRead) { 1733 SamplesInWAVE = AllSamplesRead; 1734 fseek(e.outputFile, e.seek_ref + 4, SEEK_SET); 1735 writeStreamInfo ( &e, m.Max_Band, m.MS_Channelmode > 0, SamplesInWAVE, 1736 m.SampleFreq, Wave.Channels > 2 ? 2 : Wave.Channels, 0, 0, 0, 0); 1737 writeBlock(&e, "SI", MPC_TRUE, si_size); 1738 fseek(e.outputFile, 0, SEEK_END); 1739 } 1740 1732 1741 ShowProgress (&m, SamplesInWAVE, SamplesInWAVE, e.outputBits ); 1733 1742
Note: See TracChangeset
for help on using the changeset viewer.