mirror of https://github.com/odrling/Aegisub
Fix dummy and pcm audio providers.
Originally committed to SVN as r5304.
This commit is contained in:
parent
65d216e60d
commit
37bcd0cc12
|
@ -27,6 +27,8 @@ SRC = \
|
|||
common/video_frame.cpp \
|
||||
audio/downmix.cpp \
|
||||
audio/convert.cpp \
|
||||
audio/dummy_audio.cpp \
|
||||
audio/pcm.cpp \
|
||||
$(SRC_OPT)
|
||||
|
||||
HEADERS = \
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "audio_provider_dummy.h"
|
||||
#include "utils.h"
|
||||
#include "dummy_audio.h"
|
||||
|
||||
|
||||
namespace media {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/// @ingroup audio_input
|
||||
///
|
||||
|
||||
#include "include/aegisub/audio_provider.h"
|
||||
#include "libmedia/audio.h"
|
||||
|
||||
namespace media {
|
||||
|
||||
|
|
|
@ -46,17 +46,14 @@
|
|||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <wx/file.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#endif
|
||||
|
||||
#include <libaegisub/log.h>
|
||||
|
||||
#include "aegisub_endian.h"
|
||||
#include "audio_provider_pcm.h"
|
||||
#include "compat.h"
|
||||
#include "utils.h"
|
||||
#include "pcm.h"
|
||||
//#include "compat.h"
|
||||
//#include "utils.h"
|
||||
|
||||
|
||||
namespace media {
|
||||
|
@ -64,7 +61,7 @@ namespace media {
|
|||
/// @brief DOCME
|
||||
/// @param filename
|
||||
///
|
||||
PCMAudioProvider::PCMAudioProvider(const wxString &filename)
|
||||
PCMAudioProvider::PCMAudioProvider(const std::string &filename)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
file_handle = CreateFile(
|
||||
|
@ -103,10 +100,10 @@ PCMAudioProvider::PCMAudioProvider(const wxString &filename)
|
|||
|
||||
#else
|
||||
|
||||
file_handle = open(filename.mb_str(*wxConvFileName), O_RDONLY);
|
||||
file_handle = open(filename.c_str(), O_RDONLY);
|
||||
|
||||
if (file_handle == -1) {
|
||||
throw agi::FileNotFoundError(STD_STR(filename));
|
||||
throw agi::FileNotFoundError(filename);
|
||||
}
|
||||
|
||||
struct stat filestats;
|
||||
|
@ -330,7 +327,7 @@ public:
|
|||
/// @brief DOCME
|
||||
/// @param _filename
|
||||
///
|
||||
RiffWavPCMAudioProvider(const wxString &_filename)
|
||||
RiffWavPCMAudioProvider(const std::string &_filename)
|
||||
: PCMAudioProvider(_filename)
|
||||
{
|
||||
filename = _filename;
|
||||
|
@ -520,7 +517,7 @@ public:
|
|||
/// @brief DOCME
|
||||
/// @param _filename
|
||||
///
|
||||
Wave64AudioProvider(const wxString &_filename)
|
||||
Wave64AudioProvider(const std::string &_filename)
|
||||
: PCMAudioProvider(_filename)
|
||||
{
|
||||
filename = _filename;
|
||||
|
@ -614,7 +611,7 @@ public:
|
|||
/// @brief DOCME
|
||||
/// @param filename
|
||||
///
|
||||
AudioProvider *CreatePCMAudioProvider(const wxString &filename)
|
||||
AudioProvider *CreatePCMAudioProvider(const std::string &filename)
|
||||
{
|
||||
std::string msg;
|
||||
try {
|
||||
|
|
|
@ -36,16 +36,13 @@
|
|||
|
||||
#ifndef AGI_PRE
|
||||
#include <vector>
|
||||
|
||||
#include <wx/file.h>
|
||||
#include <wx/thread.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "include/aegisub/audio_provider.h"
|
||||
#include "libmedia/audio.h"
|
||||
|
||||
|
||||
namespace media {
|
||||
|
@ -81,7 +78,7 @@ private:
|
|||
#endif
|
||||
|
||||
protected:
|
||||
PCMAudioProvider(const wxString &filename); // Create base object and open the file mapping
|
||||
PCMAudioProvider(const std::string &filename); // Create base object and open the file mapping
|
||||
virtual ~PCMAudioProvider(); // Closes the file mapping
|
||||
char * EnsureRangeAccessible(int64_t range_start, int64_t range_length) const; // Ensure that the given range of bytes are accessible in the file mapping and return a pointer to the first byte of the requested range
|
||||
|
||||
|
@ -114,7 +111,7 @@ public:
|
|||
};
|
||||
|
||||
// Construct the right PCM audio provider (if any) for the file
|
||||
AudioProvider *CreatePCMAudioProvider(const wxString &filename);
|
||||
AudioProvider *CreatePCMAudioProvider(const std::string &filename);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
|
Loading…
Reference in New Issue