rollback to windowsmedia + fix on audio crash

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent f708b59790
commit 10950bd702
  1. 16
      src/podcast/UBPodcastController.cpp
  2. 15
      src/podcast/podcast.pri
  3. 5
      src/podcast/windowsmedia/UBWaveRecorder.cpp

@ -59,8 +59,8 @@
#ifdef Q_OS_WIN
#include "ffmpeg/UBFFmpegVideoEncoder.h"
#include "ffmpeg/UBMicrophoneInput.h"
#include "windowsmedia/UBWindowsMediaVideoEncoder.h"
#include "windowsmedia/UBWaveRecorder.h"
#elif defined(Q_OS_OSX)
#include "ffmpeg/UBFFmpegVideoEncoder.h"
#include "ffmpeg/UBMicrophoneInput.h"
@ -308,7 +308,13 @@ void UBPodcastController::start()
applicationMainModeChanged(UBApplication::applicationController->displayMode());
#ifdef Q_OS_WIN
mVideoEncoder = new UBWindowsMediaVideoEncoder(this); //deleted on stop
#elif defined(Q_OS_OSX)
mVideoEncoder = new UBFFmpegVideoEncoder(this);
#elif defined(Q_OS_LINUX)
mVideoEncoder = new UBFFmpegVideoEncoder(this);
#endif
if (mVideoEncoder)
{
@ -799,7 +805,13 @@ QStringList UBPodcastController::audioRecordingDevices()
{
QStringList devices;
#ifdef Q_OS_WIN
devices = UBWaveRecorder::waveInDevices();
#elif defined(Q_OS_OSX)
devices = UBMicrophoneInput::availableDevicesNames();
#elif defined(Q_OS_LINUX)
devices = UBMicrophoneInput::availableDevicesNames();
#endif
return devices;
}

@ -13,16 +13,13 @@ SOURCES += src/podcast/UBPodcastController.cpp \
win32 {
SOURCES += src/podcast/ffmpeg/UBFFmpegVideoEncoder.cpp \
src/podcast/ffmpeg/UBMicrophoneInput.cpp
HEADERS += src/podcast/ffmpeg/UBFFmpegVideoEncoder.h \
src/podcast/ffmpeg/UBMicrophoneInput.h
LIBS += -L$$PWD/../OpenBoard-ThirdParty/ffmpeg/lib/ -lavformat -lavcodec -lswscale -lswresample -lavutil
SOURCES += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp \
src/podcast/windowsmedia/UBWindowsMediaFile.cpp \
src/podcast/windowsmedia/UBWaveRecorder.cpp
INCLUDEPATH += $$PWD/../OpenBoard-ThirdParty/ffmpeg/include
DEPENDPATH += $$PWD/../OpenBoard-ThirdParty/ffmpeg/include
HEADERS += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h \
src/podcast/windowsmedia/UBWindowsMediaFile.h \
src/podcast/windowsmedia/UBWaveRecorder.h
}
macx {

@ -76,8 +76,7 @@ bool UBWaveRecorder::init(const QString& waveInDeviceName)
}
}
WAVEFORMATEX format;
format.cbSize = 0;
WAVEFORMATEX format = {0};
format.wFormatTag = WAVE_FORMAT_PCM;
format.nChannels = mNbChannels;
format.wBitsPerSample = mBitsPerSample;
@ -85,7 +84,7 @@ bool UBWaveRecorder::init(const QString& waveInDeviceName)
format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8);
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
if (waveInOpen(&mWaveInDevice, deviceID, &format, (DWORD)waveInProc, (DWORD_PTR)this, CALLBACK_FUNCTION) != MMSYSERR_NOERROR)
if (waveInOpen(&mWaveInDevice, deviceID, &format, reinterpret_cast<DWORD_PTR>(waveInProc), reinterpret_cast<DWORD_PTR>(this), CALLBACK_FUNCTION) != MMSYSERR_NOERROR)
{
setLastErrorMessage("Cannot open wave in device ");
return false;

Loading…
Cancel
Save