mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
movieplayer: reindent callInfoViewer()
make the callInfoViewer() function more readable by reindenting it, additionally fix a theoretically possible buffer overflow in the filename copying code git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@892 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1266,16 +1266,24 @@ printf("CMoviePlayerGui::PlayFile: exit, isMovieBrowser %d p_movie_info %x\n", i
|
|||||||
if (g_settings.mode_clock)
|
if (g_settings.mode_clock)
|
||||||
InfoClock->StartClock();
|
InfoClock->StartClock();
|
||||||
}
|
}
|
||||||
void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::string & epg_info1, const std::string & epg_channel, const int duration, const int curr_pos)
|
|
||||||
|
void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::string & epg_info1,
|
||||||
|
const std::string & epg_channel, const int duration, const int curr_pos)
|
||||||
{
|
{
|
||||||
if (isMovieBrowser) {
|
if (isMovieBrowser) {
|
||||||
g_InfoViewer->showMovieTitle(playstate, epg_channel.c_str(), epg_title, epg_info1, duration, curr_pos);
|
g_InfoViewer->showMovieTitle(playstate, epg_channel.c_str(), epg_title, epg_info1,
|
||||||
} else {
|
duration, curr_pos);
|
||||||
char temp_name[255];
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* not moviebrowser => use the filename as title */
|
||||||
|
char temp_name[255] = { 0 };
|
||||||
const char *slash = strrchr(filename, '/');
|
const char *slash = strrchr(filename, '/');
|
||||||
if (slash) {
|
if (slash) {
|
||||||
slash++;
|
slash++;
|
||||||
int len = strlen(slash);
|
int len = strlen(slash);
|
||||||
|
if (len > 254)
|
||||||
|
len = 254;
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
if (slash[i] == '_')
|
if (slash[i] == '_')
|
||||||
temp_name[i] = ' ';
|
temp_name[i] = ' ';
|
||||||
@@ -1284,10 +1292,9 @@ void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::s
|
|||||||
}
|
}
|
||||||
temp_name[len] = 0;
|
temp_name[len] = 0;
|
||||||
}
|
}
|
||||||
// g_InfoViewer->showTitle(0, temp_name, 0, 0); // UTF-8
|
|
||||||
g_InfoViewer->showMovieTitle(playstate, temp_name, "", "", duration, curr_pos);
|
g_InfoViewer->showMovieTitle(playstate, temp_name, "", "", duration, curr_pos);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
void CMoviePlayerGui::showHelpTS()
|
void CMoviePlayerGui::showHelpTS()
|
||||||
{
|
{
|
||||||
Helpbox helpbox;
|
Helpbox helpbox;
|
||||||
|
Reference in New Issue
Block a user