Mercurial > mm7
changeset 2408:4bb0b96cec90
Слияние
author | Ritor1 |
---|---|
date | Mon, 14 Jul 2014 18:09:42 +0600 |
parents | 82512695b45d (current diff) 378e5732ba38 (diff) |
children | b29880e9ee79 |
files | |
diffstat | 2 files changed, 21 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/MapsLongTimer.h Mon Jul 14 10:29:35 2014 +0600 +++ b/MapsLongTimer.h Mon Jul 14 18:09:42 2014 +0600 @@ -20,5 +20,5 @@ __int16 field_1E; }; #pragma pack(pop) -extern MapsLongTimer MapsLongTimersList[100]; +extern MapsLongTimer MapsLongTimersList[100]; //array_5B5928
--- a/MediaPlayer.cpp Mon Jul 14 10:29:35 2014 +0600 +++ b/MediaPlayer.cpp Mon Jul 14 18:09:42 2014 +0600 @@ -23,6 +23,7 @@ #include "Log.h" #include "MediaPlayer.h" +#include "Log.h" using namespace Media; Media::MPlayer *pMediaPlayer; @@ -36,44 +37,48 @@ void PlayAudio(const wchar_t * pFilename); void LoadMovie(const char *); -class MemoryStream +class MemoryStream // { public: - inline MemoryStream(void *data, size_t data_size) + inline MemoryStream(void *data, size_t data_size)//inline - , MemoryStream - { this->data_size = data_size; this->data = data; this->current_pos = 0; } - inline MemoryStream() + inline MemoryStream() // { this->data_size = 0; this->data = nullptr; this->current_pos = 0; } - inline ~MemoryStream() + inline ~MemoryStream()// { + //Log::Warning(L"Destructor: data delete %u", data); if (data) delete [] data; } - inline size_t Write(void *buffer, size_t num_bytes) + inline size_t Write(void *buffer, size_t num_bytes)// { if (!data) { data_size = 32 + num_bytes; - data = new char[data_size]; + data = new char[data_size];// data + //Log::Warning(L"new data %u", data); current_pos = 0; } - else if (current_pos + num_bytes >= data_size) + else if (current_pos + num_bytes >= data_size) // { int new_data_size = data_size + num_bytes + data_size / 8 + 4; - auto new_data = new char[new_data_size]; + auto new_data = new char[new_data_size];// + //Log::Warning(L"new new_data %u", new_data); memcpy(new_data, data, data_size); - delete [] data; - + //Log::Warning(L"data delete %u", data); + delete [] data;// data + data_size = new_data_size; data = new_data; } @@ -82,7 +87,7 @@ return num_bytes; } - inline size_t Read(void *buffer, size_t num_bytes) + inline size_t Read(void *buffer, size_t num_bytes) // { size_t read_size = min(num_bytes, data_size - current_pos); if (read_size) @@ -93,11 +98,11 @@ return read_size; } - inline void Reset() + inline void Reset()// { current_pos = 0; } - inline void SeekToEnd() + inline void SeekToEnd()// { current_pos = data_size; } @@ -931,6 +936,7 @@ if (video.dec_ctx->frame_number >= video.stream->duration - 1 ) end_current_file = true; } + // if (av_read_frame(format_ctx, avpacket) < 0) // { // probably movie is finished @@ -947,7 +953,7 @@ if (DecodeAudioFrame(audio.dec_ctx, avpacket, avframe, &audio_data, &num_audio_samples)) provider->Stream16(audio_data_in_device, num_audio_samples, audio_data.Ptr()); //continue; - } + } // audio_data // Decode video frame //