mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libspark/player: use int instead of short in some places
This commit is contained in:
@@ -743,7 +743,7 @@ static int PlaybackSwitchSubtitle(Context_t *context, int* track) {
|
|||||||
playback_err("manager set track failed\n");
|
playback_err("manager set track failed\n");
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
if (*track == 0xffff) {
|
if (*track < 0) {
|
||||||
//CHECK FOR SUBTITLES
|
//CHECK FOR SUBTITLES
|
||||||
if (context->container && context->container->textSrtContainer)
|
if (context->container && context->container->textSrtContainer)
|
||||||
context->container->textSrtContainer->Command(context, CONTAINER_INIT, context->playback->uri+7);
|
context->container->textSrtContainer->Command(context, CONTAINER_INIT, context->playback->uri+7);
|
||||||
@@ -798,14 +798,14 @@ static int PlaybackSwitchDVBSubtitle(Context_t *context, int* pid) {
|
|||||||
playback_printf(10, "Track: %d\n", *pid);
|
playback_printf(10, "Track: %d\n", *pid);
|
||||||
|
|
||||||
if (context && context->manager && context->manager->dvbsubtitle ) {
|
if (context && context->manager && context->manager->dvbsubtitle ) {
|
||||||
if (context->manager->dvbsubtitle->Command(context, *pid == 0xffff ? MANAGER_DEL : MANAGER_SET, pid) < 0) {
|
if (context->manager->dvbsubtitle->Command(context, *pid < 0 ? MANAGER_DEL : MANAGER_SET, pid) < 0) {
|
||||||
playback_err("dvbsub manager set track failed\n");
|
playback_err("dvbsub manager set track failed\n");
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
ret = cERR_PLAYBACK_ERROR;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
playback_err("no dvbsubtitle\n");
|
playback_err("no dvbsubtitle\n");
|
||||||
|
|
||||||
if (*pid == 0xffff)
|
if (*pid < 0)
|
||||||
container_ffmpeg_update_tracks(context, context->playback->uri, 0);
|
container_ffmpeg_update_tracks(context, context->playback->uri, 0);
|
||||||
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
@@ -819,14 +819,14 @@ static int PlaybackSwitchTeletext(Context_t *context, int* pid) {
|
|||||||
playback_printf(10, "Track: %d\n", *pid);
|
playback_printf(10, "Track: %d\n", *pid);
|
||||||
|
|
||||||
if (context && context->manager && context->manager->teletext ) {
|
if (context && context->manager && context->manager->teletext ) {
|
||||||
if (context->manager->teletext->Command(context, *pid == 0xffff ? MANAGER_DEL : MANAGER_SET, pid)) {
|
if (context->manager->teletext->Command(context, *pid < 0 ? MANAGER_DEL : MANAGER_SET, pid)) {
|
||||||
playback_err("ttxsub manager set track failed\n");
|
playback_err("ttxsub manager set track failed\n");
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
ret = cERR_PLAYBACK_ERROR;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
playback_err("no ttxsubtitle\n");
|
playback_err("no ttxsubtitle\n");
|
||||||
|
|
||||||
if (*pid == 0xffff)
|
if (*pid < 0)
|
||||||
container_ffmpeg_update_tracks(context, context->playback->uri, 0);
|
container_ffmpeg_update_tracks(context, context->playback->uri, 0);
|
||||||
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
|
@@ -97,7 +97,7 @@ void cPlayback::Close(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Used by Fileplay
|
//Used by Fileplay
|
||||||
bool cPlayback::Start(char *filename, unsigned short vpid, int vtype, unsigned short apid, int ac3, unsigned int, bool no_probe)
|
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, unsigned int, bool no_probe)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool isHTTP = false;
|
bool isHTTP = false;
|
||||||
@@ -275,7 +275,7 @@ bool cPlayback::Stop(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetAPid(unsigned short pid, bool ac3 __attribute__((unused)))
|
bool cPlayback::SetAPid(int pid, bool ac3 __attribute__((unused)))
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int i=pid;
|
int i=pid;
|
||||||
@@ -287,7 +287,7 @@ bool cPlayback::SetAPid(unsigned short pid, bool ac3 __attribute__((unused)))
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetSubtitlePid(unsigned short pid)
|
bool cPlayback::SetSubtitlePid(int pid)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int i=pid;
|
int i=pid;
|
||||||
@@ -299,7 +299,7 @@ bool cPlayback::SetSubtitlePid(unsigned short pid)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetDvbsubtitlePid(unsigned short pid)
|
bool cPlayback::SetDvbsubtitlePid(int pid)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int i=pid;
|
int i=pid;
|
||||||
@@ -311,7 +311,7 @@ bool cPlayback::SetDvbsubtitlePid(unsigned short pid)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetTeletextPid(unsigned short pid)
|
bool cPlayback::SetTeletextPid(int pid)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int i=pid;
|
int i=pid;
|
||||||
@@ -498,7 +498,7 @@ bool cPlayback::SetPosition(int position, bool absolute)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
|
void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int max_numpida = *numpida;
|
int max_numpida = *numpida;
|
||||||
@@ -515,7 +515,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
int _pid;
|
int _pid;
|
||||||
char _lang[strlen(TrackList[i])];
|
char _lang[strlen(TrackList[i])];
|
||||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
||||||
apids[j]=(uint16_t)_pid;
|
apids[j]=_pid;
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
||||||
if( !strncmp("A_MPEG/L3", TrackList[i+1], 9))
|
if( !strncmp("A_MPEG/L3", TrackList[i+1], 9))
|
||||||
ac3flags[j] = 4;
|
ac3flags[j] = 4;
|
||||||
@@ -545,7 +545,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int max_numpids = *numpids;
|
int max_numpids = *numpids;
|
||||||
@@ -562,7 +562,7 @@ void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::stri
|
|||||||
int _pid;
|
int _pid;
|
||||||
char _lang[strlen(TrackList[i])];
|
char _lang[strlen(TrackList[i])];
|
||||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
||||||
pids[j]=(uint16_t)_pid;
|
pids[j]=_pid;
|
||||||
language[j]=std::string(_lang);
|
language[j]=std::string(_lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -575,7 +575,7 @@ void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::stri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllDvbsubtitlePids(int *pids, unsigned int *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int max_numpids = *numpids;
|
int max_numpids = *numpids;
|
||||||
@@ -592,7 +592,7 @@ void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::s
|
|||||||
int _pid;
|
int _pid;
|
||||||
char _lang[strlen(TrackList[i])];
|
char _lang[strlen(TrackList[i])];
|
||||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
||||||
pids[j]=(uint16_t)_pid;
|
pids[j]=_pid;
|
||||||
language[j]=std::string(_lang);
|
language[j]=std::string(_lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -605,7 +605,7 @@ void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllTeletextsubtitlePids(int *pids, unsigned int *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int max_numpids = *numpids;
|
int max_numpids = *numpids;
|
||||||
@@ -625,7 +625,7 @@ void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, s
|
|||||||
continue;
|
continue;
|
||||||
if (type != 2 && type != 5) // return subtitles only
|
if (type != 2 && type != 5) // return subtitles only
|
||||||
continue;
|
continue;
|
||||||
pids[j]=(uint16_t)_pid;
|
pids[j]=_pid;
|
||||||
language[j]=std::string(TrackList[i]);
|
language[j]=std::string(TrackList[i]);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
@@ -638,10 +638,10 @@ void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short cPlayback::GetTeletextPid(void)
|
int cPlayback::GetTeletextPid(void)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
int pid = 0;
|
int pid = -1;
|
||||||
if(player && player->manager && player->manager->teletext) {
|
if(player && player->manager && player->manager->teletext) {
|
||||||
char ** TrackList = NULL;
|
char ** TrackList = NULL;
|
||||||
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
||||||
@@ -664,9 +664,10 @@ unsigned short cPlayback::GetTeletextPid(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("teletext pid id %d (0x%x)\n", pid, pid);
|
printf("teletext pid id %d (0x%x)\n", pid, pid);
|
||||||
return (unsigned short)pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* dummy functions for subtitles */
|
/* dummy functions for subtitles */
|
||||||
void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/)
|
void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/)
|
||||||
{
|
{
|
||||||
@@ -685,6 +686,7 @@ void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string
|
|||||||
positions.clear();
|
positions.clear();
|
||||||
titles.clear();
|
titles.clear();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
cPlayback::cPlayback(int num __attribute__((unused)), void (*fbcb)(uint32_t **, unsigned int *, unsigned int *, unsigned int *, void (**)(void)))
|
cPlayback::cPlayback(int num __attribute__((unused)), void (*fbcb)(uint32_t **, unsigned int *, unsigned int *, unsigned int *, void (**)(void)))
|
||||||
|
@@ -27,30 +27,32 @@ class cPlayback
|
|||||||
|
|
||||||
bool Open(playmode_t PlayMode);
|
bool Open(playmode_t PlayMode);
|
||||||
void Close(void);
|
void Close(void);
|
||||||
bool Start(char *filename, unsigned short vpid, int vtype, unsigned short apid,
|
bool Start(char *filename, int vpid, int vtype, int apid,
|
||||||
int ac3, unsigned int duration, bool no_probe = true);
|
int ac3, unsigned int duration, bool no_probe = true);
|
||||||
bool SetAPid(unsigned short pid, bool ac3);
|
bool SetAPid(int pid, bool ac3);
|
||||||
bool SetSubtitlePid(unsigned short pid);
|
bool SetSubtitlePid(int pid);
|
||||||
bool SetDvbsubtitlePid(unsigned short pid);
|
bool SetDvbsubtitlePid(int pid);
|
||||||
bool SetTeletextPid(unsigned short pid);
|
bool SetTeletextPid(int pid);
|
||||||
unsigned short GetAPid(void) { return mAudioStream; }
|
int GetAPid(void) { return mAudioStream; }
|
||||||
unsigned short GetSubtitlePid(void) { return mSubtitleStream; }
|
int GetSubtitlePid(void) { return mSubtitleStream; }
|
||||||
unsigned short GetDvbsubtitlePid(void) { return mDvbsubtitleStream; }
|
int GetDvbsubtitlePid(void) { return mDvbsubtitleStream; }
|
||||||
unsigned short GetTeletextPid(void);
|
int GetTeletextPid(void);
|
||||||
void SuspendSubtitle(bool);
|
void SuspendSubtitle(bool);
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
bool GetSpeed(int &speed) const;
|
bool GetSpeed(int &speed) const;
|
||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
void GetPts(uint64_t &pts);
|
void GetPts(uint64_t &pts);
|
||||||
bool SetPosition(int position, bool absolute = false);
|
bool SetPosition(int position, bool absolute = false);
|
||||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
||||||
void FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language);
|
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||||
void FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language);
|
void FindAllDvbsubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||||
void FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpidt, std::string *tlanguage);
|
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage);
|
||||||
void RequestAbort(void);
|
void RequestAbort(void);
|
||||||
|
#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);
|
||||||
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
// Functions that are not used by movieplayer.cpp:
|
// Functions that are not used by movieplayer.cpp:
|
||||||
bool GetOffset(off64_t &offset);
|
bool GetOffset(off64_t &offset);
|
||||||
|
Reference in New Issue
Block a user