mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Fix setAudioStream
This commit is contained in:
@@ -569,6 +569,17 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MediaEngine::setAudioStream(int streamNum) {
|
||||
if (m_audioStream == streamNum)
|
||||
return true;
|
||||
|
||||
m_audioStream = streamNum;
|
||||
if (m_demux) {
|
||||
m_demux->setAudioChannel(streamNum);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MediaEngine::setVideoDim(int width, int height)
|
||||
{
|
||||
#ifdef USE_FFMPEG
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
bool setVideoStream(int streamNum, bool force = false);
|
||||
// TODO: Return false if the stream doesn't exist.
|
||||
bool setAudioStream(int streamNum) { m_audioStream = streamNum; return true; }
|
||||
bool setAudioStream(int streamNum);
|
||||
|
||||
u8 *getFrameImage();
|
||||
int getRemainSize();
|
||||
|
||||
@@ -187,10 +187,16 @@ bool MpegDemux::skipPackHeader() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void MpegDemux::setAudioChannel(int audioChannel) {
|
||||
if (m_audioChannel != audioChannel) {
|
||||
m_audioChannel = audioChannel;
|
||||
m_audioStream.clear();
|
||||
}
|
||||
}
|
||||
|
||||
bool MpegDemux::demux(int audioChannel)
|
||||
{
|
||||
if (audioChannel >= 0)
|
||||
m_audioChannel = audioChannel;
|
||||
setAudioChannel(audioChannel);
|
||||
|
||||
bool looksValid = false;
|
||||
bool needMore = false;
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
|
||||
bool addStreamData(const u8 *buf, int addSize);
|
||||
bool demux(int audioChannel);
|
||||
void setAudioChannel(int audioChannel);
|
||||
|
||||
// return its framesize
|
||||
int getNextAudioFrame(u8 **buf, int *headerCode1, int *headerCode2, s64 *pts = NULL);
|
||||
|
||||
Reference in New Issue
Block a user