diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-04-18 18:24:36 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-04-18 18:24:36 +0400 |
commit | 5f08bfd46c31bb67780ee4081428be0d22f703ae (patch) | |
tree | e5097149e2e860a761292391184dd6946c3b979e /intern/audaspace/ffmpeg/AUD_FFMPEGReader.h | |
parent | 54f31672701fae259dc28477e6b5ae323641c395 (diff) |
Fix for [#26990] Loading file w packed audio crashes
FFMPEG was reallocating buffers it didn't own and wasn't allowed to. This workaround should work now flawlessly.
Also fixing a bug regarding unpacking sounds, the UI stated unpacking to //audio/filename while it was unpacking to //sounds/filename
Diffstat (limited to 'intern/audaspace/ffmpeg/AUD_FFMPEGReader.h')
-rw-r--r-- | intern/audaspace/ffmpeg/AUD_FFMPEGReader.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h index 4d8c5e4c462..26e66859451 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h @@ -106,11 +106,21 @@ private: AUD_convert_f m_convert; /** - * The memory file to read from, only saved to keep the buffer alive. + * The memory file to read from. */ AUD_Reference<AUD_Buffer> m_membuffer; /** + * The buffer to read with. + */ + data_t* m_membuf; + + /** + * Reading position of the buffer. + */ + int64_t m_membufferpos; + + /** * Decodes a packet into the given buffer. * \param packet The AVPacket to decode. * \param buffer The target buffer. @@ -149,6 +159,9 @@ public: */ virtual ~AUD_FFMPEGReader(); + static int read_packet(void* opaque, uint8_t* buf, int buf_size); + static int64_t seek_packet(void* opaque, int64_t offset, int whence); + virtual bool isSeekable() const; virtual void seek(int position); virtual int getLength() const; |