mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
libspark/player, libeplayer3/ffmpeg: improve termination handling
This commit is contained in:
@@ -346,7 +346,7 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
}
|
}
|
||||||
ffmpeg_printf(10, "Running!\n");
|
ffmpeg_printf(10, "Running!\n");
|
||||||
|
|
||||||
while ( context && context->playback && context->playback->isPlaying ) {
|
while ( context && context->playback && context->playback->isPlaying && !context->playback->abortRequested ) {
|
||||||
|
|
||||||
//IF MOVIE IS PAUSED, WAIT
|
//IF MOVIE IS PAUSED, WAIT
|
||||||
if (context->playback->isPaused) {
|
if (context->playback->isPaused) {
|
||||||
|
@@ -15,7 +15,7 @@ extern ManagerHandler_t ManagerHandler;
|
|||||||
#include "playback_libeplayer3.h"
|
#include "playback_libeplayer3.h"
|
||||||
#include "subtitle.h"
|
#include "subtitle.h"
|
||||||
|
|
||||||
static Context_t *player;
|
static Context_t *player = NULL;
|
||||||
|
|
||||||
extern cAudio *audioDecoder;
|
extern cAudio *audioDecoder;
|
||||||
extern cVideo *videoDecoder;
|
extern cVideo *videoDecoder;
|
||||||
@@ -710,8 +710,17 @@ void cPlayback::SuspendSubtitle(bool b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::RequestAbort() {
|
void cPlayback::RequestAbort() {
|
||||||
if (player->playback)
|
if (player && player->playback) {
|
||||||
player->playback->abortRequested = 1;
|
player->playback->abortRequested = 1;
|
||||||
|
while (player->playback->isPlaying)
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cPlayback::isPlaying() {
|
||||||
|
if (player && player->playback)
|
||||||
|
return player->playback->isPlaying;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
bool cPlayback::IsPlaying(void) const
|
bool cPlayback::IsPlaying(void) const
|
||||||
|
@@ -48,6 +48,7 @@ class cPlayback
|
|||||||
void FindAllDvbsubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
void FindAllDvbsubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage);
|
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage);
|
||||||
void RequestAbort(void);
|
void RequestAbort(void);
|
||||||
|
bool isPlaying(void);
|
||||||
#if 0
|
#if 0
|
||||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||||
bool SelectSubtitles(int pid);
|
bool SelectSubtitles(int pid);
|
||||||
|
Reference in New Issue
Block a user