diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-19 19:42:26 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-19 19:42:26 +0000 |
| commit | 64e0bfa3e7c648ba3d6eba5b21ca0a927e5e5b92 (patch) | |
| tree | 69ace5d557cc07f2487b1f14f4224640c0b2e976 | |
| parent | 2b4c4d7ebb20b9af1b3d0fc72179e2c84def4a64 (diff) | |
| download | qmmp-64e0bfa3e7c648ba3d6eba5b21ca0a927e5e5b92.tar.gz qmmp-64e0bfa3e7c648ba3d6eba5b21ca0a927e5e5b92.tar.bz2 qmmp-64e0bfa3e7c648ba3d6eba5b21ca0a927e5e5b92.zip | |
faster ape seeking
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@694 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 49c13da9f..919830cfc 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -159,7 +159,7 @@ bool DecoderFFmpeg::initialize() bitrate = c->bit_rate; chan = c->channels; - wma_outbuf = new uint8_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t)]; + wma_outbuf = new uint8_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t) + globalBufferSize]; inited = TRUE; qDebug("DecoderFFmpeg: initialize succes"); return TRUE; @@ -236,12 +236,12 @@ void DecoderFFmpeg::run() out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t); l = avcodec_decode_audio2(c, (int16_t *)(wma_outbuf), &out_size, inbuf_ptr, size); - if(l < 0) + if (l < 0) goto end; ffmpeg_out(out_size); size -= l; inbuf_ptr += l; - if (pkt.data) + if (pkt.data) av_free_packet(&pkt); } bitrate = c->bit_rate/1024; @@ -288,7 +288,7 @@ void DecoderFFmpeg::ffmpeg_out(int size) return; int at = 0; int to_copy = 0; - while (size > 0 && !user_stop) + while ((size > 0) && !user_stop && (seekTime < 0)) //ape fast seeking hack { to_copy = qMin(int(globalBufferSize - output_at), int(size) ); memmove ( (char *) (output_buf + output_at), wma_outbuf + at, to_copy); |
