rasc hat geschrieben:Das liegt wohl daran, dass neue Funktionen erst unter dem Menuepunkt "experimentell" zum Testen zur Verfuegung gestellt werden und erst bei erfolgreichem Test "produktiv" geschaltet werden...
Jetzt wo die Ton-Umschaltung so schön läuft:
können wir nicht
endlich barfs audio-patches ins cvs einfließen lassen?
Die patches laufen jetzt schon seit Monaten problemlos als diff gegen das aktuelle cvs.
Hiermit würde die Sache erst so richtig rund.
http://www.bengt-martensson.de/dbox2/#Barf%27s+Patches
For Neutrino. Using this patch, Tuxbox will, for each channel, remember the last selected AudioPID (that characterizes an audio channel) and save it, also between reboots. When returning to the channel, it will attempt to use the previously selected audio channel, if still available. Patch is against version 1.367 of zapit.cpp.
Diskutiert hatten wir das seinerzeit
hier
http://forum.tuxbox-cvs.sourceforge.net ... 8bd0999681
hier
http://forum.tuxbox-cvs.sourceforge.net ... hp?t=30640
und hier
http://forum.tuxbox-cvs.sourceforge.net ... 7e20d1182e
http://www.bengt-martensson.de/dbox2/za ... 2005-07-03
Code: Alles auswählen
--- zapit.cpp.~1.372~ 2005-07-02 15:44:33.000000000 +0200
+++ zapit.cpp 2005-07-03 17:20:58.320584280 +0200
@@ -44,6 +44,10 @@
#include <config.h>
#endif
+// AudioPIDs per channel are saved here between sessions.
+// define to /dev/null to disable
+#define AUDIO_CONFIG_FILE "/var/tuxbox/config/zapit/audioPIDs.data"
+
/* tuxbox headers */
#include <configfile.h>
#include <connection/basicserver.h>
@@ -92,6 +96,9 @@
CDemux *teletextDemux = NULL;
CDemux *videoDemux = NULL;
+// This associative array holds the last selected AudioPid for each channel
+map<t_channel_id, unsigned short> audio_map;
+
/* current zapit mode */
enum {
TV_MODE = 0x01,
@@ -173,11 +180,36 @@
if (config.getModifiedFlag())
config.saveConfig(CONFIGFILE);
+ FILE *audio_config_file = fopen(AUDIO_CONFIG_FILE, "w");
+ if (audio_config_file) {
+ for (map<t_channel_id, unsigned short>::iterator audio_map_it = audio_map.begin();
+ audio_map_it != audio_map.end();
+ audio_map_it++) {
+ fwrite(&(audio_map_it->first), sizeof(t_channel_id), 1,
+ audio_config_file);
+ fwrite(&(audio_map_it->second), sizeof(unsigned short), 1,
+ audio_config_file);
+ }
+ fclose(audio_config_file);
+ }
}
}
CZapitClient::responseGetLastChannel load_settings(void)
{
+ FILE *audio_config_file = fopen(AUDIO_CONFIG_FILE, "r");
+ if (audio_config_file) {
+ t_channel_id chan;
+ unsigned short apid;
+ while (! feof(audio_config_file)) {
+ fread(&chan, sizeof(t_channel_id), 1, audio_config_file);
+ fread(&apid, sizeof(unsigned short), 1, audio_config_file);
+ //printf("**** Old channelinfo: %d %d\n", (int) chan, (int) apid);
+ audio_map[chan] = apid;
+ }
+ fclose(audio_config_file);
+ }
+
CZapitClient::responseGetLastChannel lastchannel;
if (currentMode & RADIO_MODE)
@@ -207,12 +239,23 @@
static int pmt_update_fd = -1;
static bool update_pmt = false;
+void
+remember_selected_audio()
+{
+ if (channel) {
+ audio_map[channel->getServiceId()] = channel->getAudioPid();
+ DBG("*** Remembering apid = %d for channel (service-id) = %d", channel->getAudioPid(), channel->getServiceId());
+ }
+}
+
int zapit(const t_channel_id channel_id, bool in_nvod, transponder_id_t transponder_id)
{
bool transponder_change;
tallchans_iterator cit;
transponder_id_t current_transponder_id;
+ remember_selected_audio();
+
DBG("tuned_transponder_id: " PRINTF_TRANSPONDER_ID_TYPE, tuned_transponder_id);
if (transponder_id == TRANSPONDER_ID_NOT_TUNED) /* usual zap */
@@ -358,7 +401,7 @@
failed = true;
}
- thisChannel->setAudioChannel(audioChannel);
+ thisChannel->setAudioChannel(audioChannel);
if ((!failed) && (thisChannel->getAudioPid() == NONE) && (thisChannel->getVideoPid() == NONE)) {
WARN("neither audio nor video pid found");
@@ -378,6 +421,18 @@
else
thisChannel->getCaPmt()->ca_pmt_list_management = 0x04;
+ DBG("***Now trying to get audio right: %d\t%d\t%d\t%d",
+ thisChannel->getAudioChannelCount(),
+ thisChannel->getAudioChannel(0)->pid,
+ thisChannel->getServiceId(),
+ audio_map[thisChannel->getServiceId()]);
+ for (int i = 0; i < thisChannel->getAudioChannelCount(); i++) {
+ if (thisChannel->getAudioChannel(i)->pid == audio_map[thisChannel->getServiceId()]) {
+ DBG("***** Setting audio!\n");
+ thisChannel->setAudioChannel(i);
+ }
+ }
+
startPlayBack(thisChannel);
cam->setCaPmt(thisChannel->getCaPmt());
saveSettings(false);
@@ -427,6 +482,7 @@
/* update current channel */
channel->setAudioChannel(index);
+ remember_selected_audio();
/* set bypass mode */
CZapitAudioChannel *currentAudioChannel = channel->getAudioChannel();