diff --git a/src/driver/audiodec/wavdec.cpp b/src/driver/audiodec/wavdec.cpp index 7c6e4de40..bec2277be 100644 --- a/src/driver/audiodec/wavdec.cpp +++ b/src/driver/audiodec/wavdec.cpp @@ -37,6 +37,9 @@ #include #include #include +#include + +extern cAudio * audioDecoder; #define ProgName "WavDec" // nr of msecs to skip in ff/rev mode @@ -47,7 +50,7 @@ struct WavHeader { char ChunkID[4]; - int ChunkSize; + int ChunkSize; char Format[4]; char Subchunk1ID[4]; int Subchunk1Size; @@ -73,7 +76,7 @@ int endianTest=1; ((((l) & 0xff00) >> 8) | \ (((l) & 0x00ff) << 8))) -#define MAX_OUTPUT_SAMPLES 1022 /* AVIA_GT_PCM_MAX_SAMPLES-1 */ +#define MAX_OUTPUT_SAMPLES 2048 /* AVIA_GT_PCM_MAX_SAMPLES-1 */ CBaseDec::RetCode CWavDec::Decoder(FILE *in, int OutputFd, State* state, CAudioMetaData* meta_data, time_t* time_played, unsigned int* secondsToSkip) { @@ -98,12 +101,15 @@ CBaseDec::RetCode CWavDec::Decoder(FILE *in, int OutputFd, State* state, CAudioM Status=DATA_ERR; return Status; } - +#if 0 if (SetDSP(OutputFd, fmt, meta_data->samplerate , mChannels)) { Status=DSPSET_ERR; return Status; } +#endif + audioDecoder->PrepareClipPlay(mChannels, meta_data->samplerate, mBitsPerSample, fmt == AFMT_S16_LE ? 1 : 0); + int actSecsToSkip = (*secondsToSkip != 0) ? *secondsToSkip : MSECS_TO_SKIP / 1000; unsigned int oldSecsToSkip = *secondsToSkip; int jumppos=0; @@ -154,13 +160,15 @@ CBaseDec::RetCode CWavDec::Decoder(FILE *in, int OutputFd, State* state, CAudioM } bytes = fread(buffer, 1, buffersize, in); - if (write(OutputFd, buffer, bytes) != bytes) + //if (write(OutputFd, buffer, bytes) != bytes) + if(audioDecoder->WriteClip((unsigned char*) buffer, bytes) != bytes) { fprintf(stderr,"%s: PCM write error (%s).\n", ProgName, strerror(errno)); Status=WRITE_ERR; } *time_played = (meta_data->bitrate!=0) ? (ftell(in)-header_size)*8/meta_data->bitrate : 0; } while (bytes > 0 && *state!=STOP_REQ && Status==OK); + audioDecoder->StopClip(); free(buffer); return Status; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 3b0c5ef25..180805b0c 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -456,7 +456,7 @@ int CAudioPlayerGui::show() clear_before_update = true; update = true; } - else if (msg == CRCInput::RC_home) + else if (msg == CRCInput::RC_home || msg == CRCInput::RC_stop) { if (m_state != CAudioPlayerGui::STOP) stop(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 4882e2304..3fab73c5a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3874,7 +3874,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) } else { tvMode( false ); } - AudioMute(current_muted, false ); + AudioMute(current_muted, true); if((mode == mode_tv) && wasshift) { startAutoRecord(true); } diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 090fca401..8351d559d 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -210,9 +210,11 @@ std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh if(nr_str != "") nr = atoi(nr_str.c_str()); + int mode = NeutrinoAPI->Zapit->getMode(); for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { + ZapitChannelList * channels = mode == CZapitClient::MODE_RADIO ? &g_bouquetManager->Bouquets[i]->radioChannels : &g_bouquetManager->Bouquets[i]->tvChannels; sel=(nr==(i+1)) ? "selected=\"selected\"" : ""; - if(!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true") + if(!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true")) yresult += string_printf("\n", i + 1, sel.c_str(), (encodeString(std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) :g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); //yresult += string_printf("\n", i + 1, sel.c_str(), (encodeString(std::string(g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); @@ -282,7 +284,8 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler */*hh std::string abouquet, achannel_id, yresult, sel, sid; int bnumber = 1; - int mode = CZapitClient::MODE_CURRENT; + //int mode = CZapitClient::MODE_CURRENT; + int mode = NeutrinoAPI->Zapit->getMode(); ySplitString(para," ",abouquet, achannel_id); if(abouquet != "") diff --git a/src/zapit/src/sdt.cpp b/src/zapit/src/sdt.cpp index d452fa09e..8e652b086 100644 --- a/src/zapit/src/sdt.cpp +++ b/src/zapit/src/sdt.cpp @@ -29,6 +29,7 @@ #include // DEMUX_DEVICE #include #include +#include #include #define SDT_SIZE 1026 @@ -135,6 +136,7 @@ int nvod_service_ids( return -1; } +extern CFrontend *frontend; int parse_sdt( t_transport_stream_id *p_transport_stream_id, t_original_network_id *p_original_network_id, @@ -170,6 +172,8 @@ int parse_sdt( unsigned char mask[DMX_FILTER_SIZE]; int flen; + bool cable_hack_done = false; + bool cable = (frontend->getInfo()->type == FE_QAM); #if 1 flen = 5; memset(filter, 0x00, DMX_FILTER_SIZE); @@ -206,6 +210,7 @@ int parse_sdt( return -1; } do { +_repeat: if (dmx->Read(buffer, SDT_SIZE) < 0) { delete dmx; return -1; @@ -215,8 +220,14 @@ int parse_sdt( section_length = ((buffer[1] & 0x0F) << 8) | buffer[2]; - transport_stream_id = (buffer[3] << 8) | buffer[4]; - original_network_id = (buffer[8] << 8) | buffer[9]; + if(cable_hack_done) { + if( (transport_stream_id == ((buffer[3] << 8) | buffer[4])) && + (original_network_id == ((buffer[8] << 8) | buffer[9]))) + break; + } else { + transport_stream_id = (buffer[3] << 8) | buffer[4]; + original_network_id = (buffer[8] << 8) | buffer[9]; + } unsigned char secnum = buffer[6]; printf("[SDT] section %X last %X tsid 0x%x onid 0x%x -> %s\n", buffer[6], buffer[7], transport_stream_id, original_network_id, secdone[secnum] ? "skip" : "use"); @@ -342,6 +353,11 @@ int parse_sdt( } } while(sectotal < buffer[7]); //while (filter[4]++ != buffer[7]); + if(cable && !cable_hack_done && sectotal == 0) { + cable_hack_done = true; + secdone[0] = 0; + goto _repeat; + } delete dmx; return 0; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 721cddc28..433fd80a3 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -514,7 +514,7 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel } if(audioDecoder) { //audioDecoder->setVolume(volume_left, volume_right); - //audioDecoder->setChannel(audio_mode); //FIXME + audioDecoder->setChannel(audio_mode); } if (!we_playing)