mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
sh4 eplayer prevent segfaults caused audio rework
This commit is contained in:
@@ -349,7 +349,7 @@ bool Player::SwitchVideo(int pid)
|
|||||||
bool Player::SwitchAudio(int pid)
|
bool Player::SwitchAudio(int pid)
|
||||||
{
|
{
|
||||||
Track *track = manager.getAudioTrack(pid);
|
Track *track = manager.getAudioTrack(pid);
|
||||||
return input.SwitchAudio(track);
|
return track ? input.SwitchAudio(track) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::SwitchSubtitle(int pid)
|
bool Player::SwitchSubtitle(int pid)
|
||||||
|
@@ -141,7 +141,7 @@ bool cPlayback::Stop(void)
|
|||||||
|
|
||||||
bool cPlayback::SetAPid(int pid, bool /* ac3 */)
|
bool cPlayback::SetAPid(int pid, bool /* ac3 */)
|
||||||
{
|
{
|
||||||
hal_info("%s\n", __func__);
|
hal_info("%s:(%d)\n", __func__, pid);
|
||||||
return player->SwitchAudio(pid);
|
return player->SwitchAudio(pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,12 +308,14 @@ void cPlayback::FindAllPids(int *pids, unsigned int *ac3flags, unsigned int *num
|
|||||||
hal_info("%s\n", __func__);
|
hal_info("%s\n", __func__);
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
std::vector<Track> tracks = player->manager.getAudioTracks();
|
if (IsPlaying()) {
|
||||||
for (std::vector<Track>::iterator it = tracks.begin(); it != tracks.end() && i < *numpids; ++it) {
|
std::vector<Track> tracks = player->manager.getAudioTracks();
|
||||||
pids[i] = it->pid;
|
for (std::vector<Track>::iterator it = tracks.begin(); it != tracks.end() && i < *numpids; ++it) {
|
||||||
ac3flags[i] = (it->ac3flags > 2) ? 1 : 0;
|
pids[i] = it->pid;
|
||||||
language[i] = it->title;
|
ac3flags[i] = it->ac3flags;
|
||||||
i++;
|
language[i] = it->title;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*numpids = i;
|
*numpids = i;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user