mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
improve subtitle handling
This commit is contained in:
@@ -398,6 +398,8 @@ static void ASSThread(Context_t *context) {
|
||||
// subtitel zeitpunkt zu bestimmen und solange zu schlafen.
|
||||
#ifdef MARTII
|
||||
usleep(10000);
|
||||
if(!context->playback->mayWriteToFramebuffer)
|
||||
continue;
|
||||
getMutex(__LINE__);
|
||||
checkRegions();
|
||||
#else
|
||||
@@ -561,7 +563,7 @@ static void ASSThread(Context_t *context) {
|
||||
|
||||
ass_printf(10, "terminating\n");
|
||||
#ifdef MARTII
|
||||
pthread_exit(NULL);
|
||||
pthread_exit(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef MARTII
|
||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_SWITCH_TELETEXT, PLAYBACK_SWITCH_DVBSUBTITLE} PlaybackCmd_t;
|
||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_SWITCH_TELETEXT, PLAYBACK_SWITCH_DVBSUBTITLE, PLAYBACK_FRAMEBUFFER_LOCK, PLAYBACK_FRAMEBUFFER_UNLOCK} PlaybackCmd_t;
|
||||
#else
|
||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT} PlaybackCmd_t;
|
||||
#endif
|
||||
@@ -34,6 +34,7 @@ typedef struct PlaybackHandler_s {
|
||||
#ifdef MARTII
|
||||
unsigned char isDvbSubtitle;
|
||||
unsigned char isTeletext;
|
||||
unsigned char mayWriteToFramebuffer;
|
||||
#endif
|
||||
|
||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||
|
@@ -1100,6 +1100,16 @@ static int Command(void* _context, PlaybackCmd_t command, void * argument) {
|
||||
ret = PlaybackSwitchTeletext(context, (int*)argument);
|
||||
break;
|
||||
}
|
||||
case PLAYBACK_FRAMEBUFFER_LOCK: {
|
||||
context->playback->mayWriteToFramebuffer = 0;
|
||||
ret = cERR_PLAYBACK_NO_ERROR;
|
||||
break;
|
||||
}
|
||||
case PLAYBACK_FRAMEBUFFER_UNLOCK: {
|
||||
context->playback->mayWriteToFramebuffer = 1;
|
||||
ret = cERR_PLAYBACK_NO_ERROR;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
playback_err("PlaybackCmd %d not supported!\n", command);
|
||||
@@ -1134,6 +1144,7 @@ PlaybackHandler_t PlaybackHandler = {
|
||||
#ifdef MARTII
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
#endif
|
||||
&Command,
|
||||
"",
|
||||
|
Reference in New Issue
Block a user