mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 23:43: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.
|
// subtitel zeitpunkt zu bestimmen und solange zu schlafen.
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
|
if(!context->playback->mayWriteToFramebuffer)
|
||||||
|
continue;
|
||||||
getMutex(__LINE__);
|
getMutex(__LINE__);
|
||||||
checkRegions();
|
checkRegions();
|
||||||
#else
|
#else
|
||||||
@@ -561,7 +563,7 @@ static void ASSThread(Context_t *context) {
|
|||||||
|
|
||||||
ass_printf(10, "terminating\n");
|
ass_printf(10, "terminating\n");
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef MARTII
|
#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
|
#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;
|
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
|
#endif
|
||||||
@@ -34,6 +34,7 @@ typedef struct PlaybackHandler_s {
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
unsigned char isDvbSubtitle;
|
unsigned char isDvbSubtitle;
|
||||||
unsigned char isTeletext;
|
unsigned char isTeletext;
|
||||||
|
unsigned char mayWriteToFramebuffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||||
|
@@ -529,7 +529,7 @@ static int Write(void* _context, void *data) {
|
|||||||
int DataLength;
|
int DataLength;
|
||||||
unsigned long long int Pts;
|
unsigned long long int Pts;
|
||||||
float Duration;
|
float Duration;
|
||||||
|
|
||||||
subtitle_printf(10, "\n");
|
subtitle_printf(10, "\n");
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
|
@@ -1100,6 +1100,16 @@ static int Command(void* _context, PlaybackCmd_t command, void * argument) {
|
|||||||
ret = PlaybackSwitchTeletext(context, (int*)argument);
|
ret = PlaybackSwitchTeletext(context, (int*)argument);
|
||||||
break;
|
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
|
#endif
|
||||||
default:
|
default:
|
||||||
playback_err("PlaybackCmd %d not supported!\n", command);
|
playback_err("PlaybackCmd %d not supported!\n", command);
|
||||||
@@ -1134,6 +1144,7 @@ PlaybackHandler_t PlaybackHandler = {
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
1,
|
||||||
#endif
|
#endif
|
||||||
&Command,
|
&Command,
|
||||||
"",
|
"",
|
||||||
|
Reference in New Issue
Block a user