From b61bc1aa90bc0d907dd786264e5e42e69e5e3283 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 18:24:14 +0100 Subject: [PATCH 1/4] neutrinoyparser: fix string literal warning with newer gcc Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee5f73c64d802a7c2e14e6380d14a3bfe556acc6 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index fbc620122..ce7537673 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -429,7 +429,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if (channel->getChannelID() == current_channel) yresult += "\n"; - yresult += string_printf("" + yresult += string_printf("" "%d. %s%s" "\n" , channel->getChannelID() @@ -461,7 +461,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } if (event.eventID) { - yresult += string_printf("" + yresult += string_printf("" "\"Program" "\n" , channel->getChannelID() @@ -469,7 +469,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: ); } - yresult += string_printf("" + yresult += string_printf("" "\"Stream\"" "\n" , channel->getChannelID() From 579d81b2f26fe43c8a23f623167009f53cacff60 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 18:25:06 +0100 Subject: [PATCH 2/4] timermanager: fix -Waddress warning with newer gcc The address of Events (wich is checked against NULL) can never be NULL, because Events is passed by reference. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/053161864373a5a685b2a1c8b20880bf16e114f6 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index cfb509c8e..6e17a1c01 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -292,9 +292,10 @@ int CTimerManager::unlockEvents() bool CTimerManager::listEvents(CTimerEventMap &Events) { +/* events is passed as reference and thus its address is never NULL if(!&Events) return false; - + */ Events.clear(); for (CTimerEventMap::iterator pos = events.begin(); pos != events.end(); ++pos) From 9da0bb35b9590119d227d798aeb60bf7998b5ab9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 22:16:42 +0100 Subject: [PATCH 3/4] driver: use newer ffmpeg API Reduce the "deprecated function" warnings a bit when compiling against recent ffmpeg releases. Just the drop-in-replacement "av_packet_unref" which works with both old and new ffmpeg versions. The other stuff needs rewrites which are not compatible with all ffmpeg releases :-( Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7154f36258be3a966e6c10b28b3d6efcc9c914c3 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) ------------------ This commit was generated by Migit --- src/driver/audiodec/ffmpegdec.cpp | 6 +++--- src/driver/record.cpp | 4 ++-- src/driver/streamts.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index a4eb905c1..c97497175 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -314,7 +314,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, } if (rpacket.stream_index != best_stream) { - av_free_packet(&rpacket); + av_packet_unref(&rpacket); continue; } @@ -373,7 +373,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, } if (time_played && avc->streams[best_stream]->time_base.den) *time_played = (pts - start_pts) * avc->streams[best_stream]->time_base.num / avc->streams[best_stream]->time_base.den; - av_free_packet(&rpacket); + av_packet_unref(&rpacket); } while (*state!=STOP_REQ && Status==OK); audioDecoder->StopClip(); @@ -381,7 +381,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, swr_free(&swr); av_free(outbuf); - av_free_packet(&rpacket); + av_packet_unref(&rpacket); av_frame_free(&frame); avcodec_close(c); //av_free(avcc); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7dd3183ab..ce7076c24 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2207,7 +2207,7 @@ void CStreamRec::run() AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { - av_free_packet(&pkt); + av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } @@ -2216,7 +2216,7 @@ void CStreamRec::run() pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); av_write_frame(ofcx, &pkt); - av_free_packet(&pkt); + av_packet_unref(&pkt); if (pkt.stream_index == stream_index) { total += (double) 1000 * pkt.duration * av_q2d(ifcx->streams[stream_index]->time_base); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f293f0e7e..e60f4b88c 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -900,7 +900,7 @@ void CStreamStream::run() AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { - av_free_packet(&pkt); + av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } @@ -909,7 +909,7 @@ void CStreamStream::run() pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); av_write_frame(ofcx, &pkt); - av_free_packet(&pkt); + av_packet_unref(&pkt); } av_read_pause(ifcx); From da356003f86063d88467148e08cd3e17cd0c8255 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 22:19:33 +0100 Subject: [PATCH 4/4] zapit: fix "comparison is always false" warnings demux Start() Stop() and pesFilter() are bool, so comparing < 0 really does not make sense. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5948f045aa0abb9c5ac1e6d6651c6d4882123bbd Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 432e19e00..375c1f228 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -926,7 +926,7 @@ bool CZapit::ChangeAudioPid(uint8_t index) return false; /* stop demux filter */ - if (audioDemux->Stop() < 0) + if (audioDemux->Stop() == false) return false; /* stop audio playback */ @@ -948,11 +948,11 @@ bool CZapit::ChangeAudioPid(uint8_t index) SetAudioStreamType(currentAudioChannel->audioChannelType); /* set demux filter */ - if (audioDemux->pesFilter(current_channel->getAudioPid()) < 0) + if (audioDemux->pesFilter(current_channel->getAudioPid()) == false) return false; /* start demux filter */ - if (audioDemux->Start() < 0) + if (audioDemux->Start() == false) return false; /* start audio playback */