Default language not taken into account for replay

Message ID 443FB552.3060901@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger April 14, 2006, 2:44 p.m. UTC
  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

Antti Hartikainen April 15, 2006, 12:03 p.m. UTC | #1
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).
  
Markus Ehrnsperger April 19, 2006, 5:20 a.m. UTC | #2
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
  

Patch

--- device.c	2006/04/09 10:46:36	1.127
+++ device.c	2006/04/14 14:34:43
@@ -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);
--- device.h	2006/04/02 13:08:13	1.74
+++ device.h	2006/04/14 14:35:13
@@ -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.
--- menu.c	2006/04/09 14:29:24	1.428
+++ menu.c	2006/04/14 14:28:34
@@ -3788,6 +3788,7 @@ 
   marks.Load(fileName);
   cRecording Recording(fileName);
   cStatus::MsgReplaying(this, Recording.Name(), Recording.FileName(), true);
+  SetTrackDescriptions(false);
 }
 
 cReplayControl::~cReplayControl()