From patchwork Sun Feb 13 17:28:35 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 11778 Received: from 232.red-213-97-27.pooles.rima-tde.net ([213.97.27.232]) by www.linuxtv.org with esmtp (Exim 4.34) id 1D0NYX-0007Di-L8 for vdr@linuxtv.org; Sun, 13 Feb 2005 18:29:14 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by 232.Red-213-97-27.pooles.rima-tde.net (Postfix) with ESMTP id 84BA5189FBA2 for ; Sun, 13 Feb 2005 18:28:42 +0100 (CET) Message-ID: <420F8E43.6070908@ventoso.org> Date: Sun, 13 Feb 2005 18:28:35 +0100 From: Luca Olivetti User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: vdr@linuxtv.org X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Subject: [vdr] [PATCH] vdr-1.3.21: keep language name on audio menu in transfer mode X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 17:29:14 -0000 Status: O X-Status: X-Keywords: X-UID: 33 The attached patch is a quick hack to keep the language names in the audio menu in transfer mode. I had to add a boolean in cPlayer because I don't think it's possible to do class introspection in C++ (in Object Pascal I'd just do an "if not Player is cTransferControl then ClrAvailableTracks"). Bye --- device.c.orig 2005-02-13 17:38:45.009642660 +0100 +++ device.c 2005-02-13 18:07:01.531071958 +0100 @@ -818,7 +818,7 @@ if (CanReplay()) { if (player) Detach(player); - ClrAvailableTracks(); + if (!Player->transferMode) ClrAvailableTracks(); pesAssembler->Reset(); player = Player; SetPlayMode(player->playMode); --- player.c.orig 2005-02-13 18:07:53.253212138 +0100 +++ player.c 2005-02-13 18:08:18.282263592 +0100 @@ -16,6 +16,7 @@ { device = NULL; playMode = PlayMode; + transferMode = false; } cPlayer::~cPlayer() --- player.h.orig 2005-02-13 18:04:24.220312321 +0100 +++ player.h 2005-02-13 18:10:22.437470023 +0100 @@ -18,6 +18,7 @@ private: cDevice *device; ePlayMode playMode; + bool transferMode; protected: void DeviceClrAvailableTracks(bool DescriptionsOnly = false) { if (device) device->ClrAvailableTracks(DescriptionsOnly); } bool DeviceSetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, const char *Description = NULL) { return device ? device->SetAvailableTrack(Type, Index, Id, Language, Description) : false; } @@ -43,6 +44,7 @@ cPlayer(ePlayMode PlayMode = pmAudioVideo); virtual ~cPlayer(); bool IsAttached(void) { return device != NULL; } + void SetTransferMode(void) { transferMode = true; } virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return false; } // Returns the current and total frame index, optionally snapped to the // nearest I-frame. --- transfer.c.orig 2005-02-13 18:08:35.818160645 +0100 +++ transfer.c 2005-02-13 18:10:39.784151559 +0100 @@ -22,6 +22,7 @@ remux = new cRemux(VPid, APids, Setup.UseDolbyDigital ? DPids : NULL, SPids); needsBufferReserve = Setup.UseDolbyDigital && VPid != 0 && DPids && DPids[0] != 0; active = false; + SetTransferMode(); } cTransfer::~cTransfer()