mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
improve subtitle handling
Origin commit data
------------------
Branch: master
Commit: 9150713e46
Author: martii <m4rtii@gmx.de>
Date: 2012-11-06 (Tue, 06 Nov 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -397,6 +397,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
|
||||
@@ -560,7 +562,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 *);
|
||||
|
@@ -1119,6 +1119,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);
|
||||
@@ -1153,6 +1163,7 @@ PlaybackHandler_t PlaybackHandler = {
|
||||
#ifdef MARTII
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
#endif
|
||||
&Command,
|
||||
"",
|
||||
|
@@ -319,7 +319,7 @@ bool cPlayback::SetSubtitlePid(unsigned short pid)
|
||||
if(pid!=mSubtitleStream){
|
||||
if(player && player->playback)
|
||||
player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void*)&i);
|
||||
mSubtitleStream=pid;
|
||||
mSubtitleStream = pid;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -631,6 +631,15 @@ cPlayback::~cPlayback()
|
||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||
}
|
||||
|
||||
#ifdef MARTII
|
||||
void cPlayback::SuspendSubtitle(bool b)
|
||||
{
|
||||
if (b)
|
||||
player->playback->Command(player, PLAYBACK_FRAMEBUFFER_LOCK, 0);
|
||||
else
|
||||
player->playback->Command(player, PLAYBACK_FRAMEBUFFER_UNLOCK, 0);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
bool cPlayback::IsPlaying(void) const
|
||||
{
|
||||
|
@@ -43,6 +43,7 @@ class cPlayback
|
||||
unsigned short GetSubtitlePid(void) { return mSubtitleStream; }
|
||||
unsigned short GetDvbsubtitlePid(void) { return mDvbsubtitleStream; }
|
||||
unsigned short GetTeletextPid(void) { return mTeletextStream; }
|
||||
void SuspendSubtitle(bool);
|
||||
#endif
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
|
Reference in New Issue
Block a user