Changeset 108
- Timestamp:
- 11/09/06 21:39:12 (18 years ago)
- Location:
- libmpcdec/branches/zorg/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpcdec/branches/zorg/src/decoder.h
r107 r108 64 64 /// @name internal state variables 65 65 //@{ 66 mpc_uint32_t stream_version;///< Streamversion of stream67 mpc_uint32_t max_band;///< Maximum band-index used in stream (0...31)68 mpc_uint32_t ms;///< Mid/side stereo (0: off, 1: on)69 mpc_uint32_t is_true_gapless;///< True gapless? (0: no, 1: yes)70 mpc_uint32_t frames;///< Number of frames in stream71 mpc_uint32_t 72 mpc_uint32_t channels; ///< Number of channels in stream66 mpc_uint32_t stream_version; ///< Streamversion of stream 67 mpc_uint32_t max_band; ///< Maximum band-index used in stream (0...31) 68 mpc_uint32_t ms; ///< Mid/side stereo (0: off, 1: on) 69 mpc_uint32_t is_true_gapless; ///< True gapless? (0: no, 1: yes) 70 mpc_uint32_t frames; ///< Number of frames in stream 71 mpc_uint32_t last_frame_samples; ///< Number of valid samples within last frame 72 mpc_uint32_t channels; ///< Number of channels in stream 73 73 74 mpc_uint32_t samples_to_skip;75 mpc_uint32_t decoded_frames;74 mpc_uint32_t samples_to_skip; ///< Number samples to skip (used for seeking) 75 mpc_uint32_t decoded_frames; ///< Number of frames decoded from file begining 76 76 77 77 // randomizer state variables -
libmpcdec/branches/zorg/src/mpc_decoder.c
r107 r108 119 119 mpc_frame_info * i) 120 120 { 121 d->decoded_frames++; 122 123 if (d->decoded_frames > d->frames && !d->is_true_gapless) { 121 mpc_int64_t samples_left; 122 if (d->decoded_frames >= d->frames && !d->is_true_gapless) { 124 123 mpc_decoder_reset_y(d); 125 124 } else { … … 129 128 mpc_decoder_synthese_filter_float(d, i->buffer); 130 129 130 d->decoded_frames++; 131 131 132 // cut off first MPC_DECODER_SYNTH_DELAY zero-samples 132 133 // reconstruct exact filelength 133 if (d->decoded_frames == d->frames && (d->stream_version & 15) == 7) { 134 d->last_frame_samples = mpc_bits_read(r, 11); 135 if (d->last_frame_samples == 0) { 136 // Encoder bugfix 137 d->last_frame_samples = MPC_FRAME_LENGTH; 138 } 139 } 140 141 mpc_int32_t samples_left = d->last_frame_samples + MPC_DECODER_SYNTH_DELAY 142 + (d->frames - d->decoded_frames) * MPC_FRAME_LENGTH; 134 if (d->decoded_frames == d->frames && (d->stream_version & 15) == 7 && 135 (d->last_frame_samples = mpc_bits_read(r, 11)) == 0) 136 // Encoder bugfix 137 d->last_frame_samples = MPC_FRAME_LENGTH; 138 139 samples_left = d->last_frame_samples + MPC_DECODER_SYNTH_DELAY 140 + ((mpc_int64_t)d->frames - d->decoded_frames) * MPC_FRAME_LENGTH; 143 141 144 142 i->samples = samples_left > MPC_FRAME_LENGTH ? MPC_FRAME_LENGTH : samples_left < 0 ? 0 : samples_left; 143 144 if (samples_left <= MPC_FRAME_LENGTH) d->is_true_gapless = 0; 145 145 146 146 if (d->samples_to_skip) { -
libmpcdec/branches/zorg/src/mpc_demux.c
r107 r108 98 98 int err; 99 99 100 memset(&d->si, 0, sizeof d->si); 101 100 102 // get header position 101 103 err = d->si.header_position = mpc_skip_id3v2(d->r); … … 106 108 if(!err) return MPC_STATUS_FILE; 107 109 108 memset(&d->si, 0, sizeof d->si); 110 d->si.tag_offset = d->si.total_file_length = d->r->get_size(d->r); 111 109 112 mpc_demux_fill(d, 4, 0); 110 113 magic[0] = mpc_bits_read(&d->bits_reader, 8);
Note: See TracChangeset
for help on using the changeset viewer.