mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
eplayer3: subtitle fixes
This commit is contained in:
@@ -1692,8 +1692,6 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename)
|
||||
context->manager->audio->Command(context, MANAGER_DEL, NULL);
|
||||
if (context->manager->video)
|
||||
context->manager->video->Command(context, MANAGER_DEL, NULL);
|
||||
if (context->manager->subtitle)
|
||||
context->manager->subtitle->Command(context, MANAGER_DEL, NULL);
|
||||
if (context->manager->dvbsubtitle)
|
||||
context->manager->dvbsubtitle->Command(context, MANAGER_DEL, NULL);
|
||||
if (context->manager->teletext)
|
||||
|
@@ -180,7 +180,7 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
}
|
||||
case MANAGER_LIST: {
|
||||
#ifdef MARTII
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
#endif
|
||||
*((char***)argument) = (char **)ManagerList(context);
|
||||
break;
|
||||
|
@@ -179,7 +179,7 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
}
|
||||
case MANAGER_LIST: {
|
||||
#ifdef MARTII
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
#endif
|
||||
*((char***)argument) = (char **)ManagerList(context);
|
||||
break;
|
||||
|
@@ -177,7 +177,7 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
}
|
||||
case MANAGER_LIST: {
|
||||
#ifdef MARTII
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
#endif
|
||||
*((char***)argument) = (char **)ManagerList(context);
|
||||
break;
|
||||
|
@@ -179,7 +179,7 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
}
|
||||
case MANAGER_LIST: {
|
||||
#ifdef MARTII
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
#endif
|
||||
*((char***)argument) = (char **)ManagerList(context);
|
||||
break;
|
||||
|
@@ -174,7 +174,7 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
}
|
||||
case MANAGER_LIST: {
|
||||
#ifdef MARTII
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
#endif
|
||||
*((char***)argument) = (char **)ManagerList(context);
|
||||
break;
|
||||
|
@@ -916,11 +916,27 @@ static int PlaybackSwitchSubtitle(Context_t *context, int* track) {
|
||||
if (context->manager && context->manager->subtitle) {
|
||||
int trackid;
|
||||
|
||||
#ifdef MARTII
|
||||
if (context->manager->subtitle->Command(context, *track == 0xffff ? MANAGER_DEL : MANAGER_SET, track) < 0)
|
||||
#else
|
||||
if (context->manager->subtitle->Command(context, MANAGER_SET, track) < 0)
|
||||
#endif
|
||||
{
|
||||
playback_err("manager set track failed\n");
|
||||
}
|
||||
#ifdef MARTII
|
||||
if (*track == 0xffff) {
|
||||
//CHECK FOR SUBTITLES
|
||||
if (context->container && context->container->textSrtContainer)
|
||||
context->container->textSrtContainer->Command(context, CONTAINER_INIT, context->playback->uri+7);
|
||||
|
||||
if (context->container && context->container->textSsaContainer)
|
||||
context->container->textSsaContainer->Command(context, CONTAINER_INIT, context->playback->uri+7);
|
||||
|
||||
if (context->container && context->container->assContainer)
|
||||
context->container->assContainer->Command(context, CONTAINER_INIT, NULL);
|
||||
}
|
||||
#endif
|
||||
context->manager->subtitle->Command(context, MANAGER_GET, &trackid);
|
||||
|
||||
/* konfetti: I make this hack a little bit nicer,
|
||||
@@ -972,7 +988,7 @@ static int PlaybackSwitchDVBSubtitle(Context_t *context, int* pid) {
|
||||
playback_err("no dvbsubtitle\n");
|
||||
|
||||
if (*pid == 0xffff)
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
|
||||
playback_printf(10, "exiting with value %d\n", ret);
|
||||
|
||||
@@ -990,10 +1006,10 @@ static int PlaybackSwitchTeletext(Context_t *context, int* pid) {
|
||||
ret = cERR_PLAYBACK_ERROR;
|
||||
}
|
||||
} else
|
||||
playback_err("no dvbsubtitle\n");
|
||||
playback_err("no ttxsubtitle\n");
|
||||
|
||||
if (*pid == 0xffff)
|
||||
container_ffmpeg_update_tracks(context, "current stream");
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri);
|
||||
|
||||
playback_printf(10, "exiting with value %d\n", ret);
|
||||
|
||||
|
Reference in New Issue
Block a user