The list of tracks given in cStatus::SetAudioTrack() is now NULL terminated

This commit is contained in:
Klaus Schmidinger 2007-08-12 10:37:58 +02:00
parent b12403458e
commit 33e5ef3a58
5 changed files with 10 additions and 5 deletions

View File

@ -1795,6 +1795,7 @@ Alexander Rieger <Alexander.Rieger@inka.de>
for reporting that the cTimer::operator=() messes up the cListObject's pointers
for reporting a memory leak in the cTimer::operator=() when using the 'aux' string
for fixing cTimer::operator=() in case a cTimer variable is assigned to itself
for making the list of tracks given in cStatus::SetAudioTrack() NULL terminated
Philip Prindeville <philipp_subx@redfish-solutions.com>
for updates to 'sources.conf'

View File

@ -5330,3 +5330,6 @@ Video Disk Recorder Revision History
code of the selected OSD language (e.g. en_US). If Setup.OSDLanguage is not
set to a particular locale that is found in VDR's locale directory, the
locale as defined in the system environment is used by default.
- The list of tracks given in cStatus::SetAudioTrack() is now NULL terminated,
so that plugins can actually use all the strings in the list, not just the
one pointed to by Index (thanks to Alexander Rieger).

3
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.457 2007/08/10 13:13:13 kls Exp $
* $Id: menu.c 1.458 2007/08/12 10:35:16 kls Exp $
*/
#include "menu.h"
@ -3491,6 +3491,7 @@ cDisplayTracks::cDisplayTracks(void)
numTracks++;
}
}
descriptions[numTracks] = 0;
timeout.Set(TRACKTIMEOUT);
displayTracks = Skins.Current()->DisplayTracks(tr("Button$Audio"), numTracks, descriptions);
Show();

4
menu.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 1.87 2007/01/07 14:40:54 kls Exp $
* $Id: menu.h 1.88 2007/08/12 10:35:42 kls Exp $
*/
#ifndef __MENU_H
@ -115,7 +115,7 @@ private:
cSkinDisplayTracks *displayTracks;
cTimeMs timeout;
eTrackType types[ttMaxTrackTypes];
char *descriptions[ttMaxTrackTypes];
char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
int numTracks, track, audioChannel;
static cDisplayTracks *currentDisplayTracks;
virtual void Show(void);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: status.h 1.9 2005/12/31 15:15:25 kls Exp $
* $Id: status.h 1.10 2007/08/12 10:34:40 kls Exp $
*/
#ifndef __STATUS_H
@ -40,7 +40,7 @@ protected:
// absolutely or relative to the current volume.
virtual void SetAudioTrack(int Index, const char * const *Tracks) {}
// The audio track has been set to the one given by Index, which
// points into the Tracks array of strings.
// points into the Tracks array of strings. Tracks is NULL terminated.
virtual void SetAudioChannel(int AudioChannel) {}
// The audio channel has been set to the given value.
// 0=stereo, 1=left, 2=right, -1=no information available.