Default language not taken into account for replay
Commit Message
Markus Ehrnsperger wrote:
> Hello,
>
> I have vdr-1.3.43 and when I replay a recording, the default language is
> not taken into account.
> So if I set the default language to French and view Arte, I hear the
> French audio track, as expected.
> When I record it and replay the recording, I hear the German audio track.
Please try the attached patch.
Klaus
Comments
On Fri, Apr 14, 2006 at 04:44:34PM +0200, Klaus Schmidinger wrote:
> Markus Ehrnsperger wrote:
> >Hello,
> >
> >I have vdr-1.3.43 and when I replay a recording, the default language is
> >not taken into account.
> >So if I set the default language to French and view Arte, I hear the
> >French audio track, as expected.
> >When I record it and replay the recording, I hear the German audio track.
>
> Please try the attached patch.
Works fine for me after quick testing (with newer recordings where language information is available ofcourse).
2006/4/15, Antti Hartikainen <ami+vdr@ah.fi>:
> On Fri, Apr 14, 2006 at 04:44:34PM +0200, Klaus Schmidinger wrote:
> > Markus Ehrnsperger wrote:
> > >Hello,
> > >
> > >I have vdr-1.3.43 and when I replay a recording, the default language is
> > >not taken into account.
> > >So if I set the default language to French and view Arte, I hear the
> > >French audio track, as expected.
> > >When I record it and replay the recording, I hear the German audio track.
> >
> > Please try the attached patch.
>
> Works fine for me after quick testing (with newer recordings where language information is available ofcourse).
Hello,
I also tested the patch and it works fine, as long as the language
information in info.vdr is correct.
Thanks, Markus
@@ -790,14 +790,19 @@
}
}
-void cDevice::ClrAvailableTracks(bool DescriptionsOnly)
+void cDevice::ClrAvailableTracks(bool DescriptionsOnly, bool IdsOnly)
{
if (DescriptionsOnly) {
for (int i = ttNone; i < ttMaxTrackTypes; i++)
*availableTracks[i].description = 0;
}
else {
- memset(availableTracks, 0, sizeof(availableTracks));
+ if (IdsOnly) {
+ for (int i = ttNone; i < ttMaxTrackTypes; i++)
+ availableTracks[i].id = 0;
+ }
+ else
+ memset(availableTracks, 0, sizeof(availableTracks));
pre_1_3_19_PrivateStream = false;
SetAudioChannel(0); // fall back to stereo
currentAudioTrackMissingCount = 0;
@@ -954,7 +959,7 @@
pesAssembler->Reset();
player = Player;
if (!Transferring())
- ClrAvailableTracks();
+ ClrAvailableTracks(false, true);
SetPlayMode(player->playMode);
player->device = this;
player->Activate(true);
@@ -356,7 +356,11 @@
virtual void SetAudioTrackDevice(eTrackType Type);
///< Sets the current audio track to the given value.
public:
- void ClrAvailableTracks(bool DescriptionsOnly = false);
+ void ClrAvailableTracks(bool DescriptionsOnly = false, bool IdsOnly = false);
+ ///< Clears the list of currently availabe tracks. If DescriptionsOnly
+ ///< is true, only the track descriptions will be cleared. With IdsOnly
+ ///< set to true only the ids will be cleared. IdsOnly is only taken
+ ///< into account if DescriptionsOnly is false.
bool SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, const char *Description = NULL);
///< Sets the track of the given Type and Index to the given values.
///< Type must be one of the basic eTrackType values, like ttAudio or ttDolby.
@@ -3788,6 +3788,7 @@
marks.Load(fileName);
cRecording Recording(fileName);
cStatus::MsgReplaying(this, Recording.Name(), Recording.FileName(), true);
+ SetTrackDescriptions(false);
}
cReplayControl::~cReplayControl()