forked from mia/Aegisub
Compilation fixes now that ffmpegsource_common.cpp has been moved over. Everything compiles correctly now.
Originally committed to SVN as r5279.
This commit is contained in:
parent
b47dd1e220
commit
ffff58d698
4 changed files with 17 additions and 7 deletions
|
@ -25,6 +25,7 @@
|
|||
#endif
|
||||
|
||||
#include "ffms_audio.h"
|
||||
#include "libaegisub/media.h"
|
||||
|
||||
namespace agi {
|
||||
namespace ffms {
|
||||
|
@ -161,9 +162,9 @@ void Audio::LoadAudio(std::string filename) {
|
|||
// }
|
||||
|
||||
#if FFMS_VERSION >= ((2 << 24) | (14 << 16) | (1 << 8) | 0)
|
||||
AudioSource = FFMS_CreateAudioSource(FileNameShort.utf8_str(), TrackNumber, Index, -1, &ErrInfo);
|
||||
AudioSource = FFMS_CreateAudioSource(filename.c_str(), TrackNumber, Index, -1, &ErrInfo);
|
||||
#else
|
||||
AudioSource = FFMS_CreateAudioSource(FileNameShort.utf8_str(), TrackNumber, Index, &ErrInfo);
|
||||
AudioSource = FFMS_CreateAudioSource(filename.c_str(), TrackNumber, Index, &ErrInfo);
|
||||
#endif
|
||||
FFMS_DestroyIndex(Index);
|
||||
Index = NULL;
|
||||
|
@ -197,9 +198,9 @@ Audio::~Audio() {
|
|||
Close();
|
||||
}
|
||||
|
||||
/// @brief Clean up
|
||||
/// @brief Clean up
|
||||
///
|
||||
void FFmpegSourceAudioProvider::Close() {
|
||||
void Audio::Close() {
|
||||
if (AudioSource) FFMS_DestroyAudioSource(AudioSource);
|
||||
#ifdef WIN32
|
||||
if (COMInited)
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
#include <map>
|
||||
#endif
|
||||
|
||||
#include "ffms_common.h"
|
||||
|
||||
namespace agi {
|
||||
namespace ffms {
|
||||
|
||||
/// @class Audio
|
||||
/// Audio file support.
|
||||
class Audio {
|
||||
class Audio : public FFmpegSourceProvider {
|
||||
FFMS_AudioSource *AudioSource; ///< audio source object
|
||||
bool COMInited; ///< COM initialization state
|
||||
|
||||
|
@ -44,6 +46,11 @@ class Audio {
|
|||
void Close();
|
||||
void LoadAudio(std::string filename);
|
||||
|
||||
int channels;
|
||||
int64_t num_samples; // for one channel, ie. number of PCM frames
|
||||
int sample_rate;
|
||||
int bytes_per_sample;
|
||||
|
||||
Audio(std::string filename);
|
||||
virtual ~Audio();
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "ffms_video.h"
|
||||
#include "libaegisub/media.h"
|
||||
#include "libaegisub/util.h"
|
||||
|
||||
//#include "aegisub_endian.h"
|
||||
//#include "compat.h"
|
||||
|
@ -265,7 +266,7 @@ void Video::Close() {
|
|||
/// @return
|
||||
///
|
||||
const media::AegiVideoFrame Video::GetFrame(int n) {
|
||||
FrameNumber = mid(0, n, GetFrameCount() - 1);
|
||||
FrameNumber = util::mid(0, n, GetFrameCount() - 1);
|
||||
|
||||
// decode frame
|
||||
const FFMS_Frame *SrcFrame = FFMS_GetFrame(VideoSource, FrameNumber, &ErrInfo);
|
||||
|
|
|
@ -28,13 +28,14 @@
|
|||
#include "libaegisub/media_video_frame.h"
|
||||
#include "libaegisub/vfr.h"
|
||||
#include "libaegisub/exception.h"
|
||||
#include "ffms_common.h"
|
||||
|
||||
namespace agi {
|
||||
namespace ffms {
|
||||
|
||||
/// @class FFmpegSourceVideoProvider
|
||||
/// @brief Implements video loading through the FFMS library.
|
||||
class Video {
|
||||
class Video : public FFmpegSourceProvider {
|
||||
private:
|
||||
FFMS_VideoSource *VideoSource; /// video source object
|
||||
const FFMS_VideoProperties *VideoInfo; /// video properties
|
||||
|
|
Loading…
Reference in a new issue