Commit b38b204b authored by Adrien Béraud's avatar Adrien Béraud Committed by Philippe Gorley

media: fix compilation warnings

Change-Id: I17acc6e9d3c8c0db3978d09b2d3606c7d7b28904
parent 6a36015c
...@@ -362,7 +362,7 @@ startLocalRecorder(const bool& audioOnly, const std::string& filepath) ...@@ -362,7 +362,7 @@ startLocalRecorder(const bool& audioOnly, const std::string& filepath)
try { try {
ring::LocalRecorderManager::instance().insertRecorder(path, std::move(rec)); ring::LocalRecorderManager::instance().insertRecorder(path, std::move(rec));
} catch (std::invalid_argument) { } catch (const std::invalid_argument&) {
return ""; return "";
} }
......
...@@ -120,8 +120,6 @@ AudioInput::readFromFile() ...@@ -120,8 +120,6 @@ AudioInput::readFromFile()
auto frame = std::make_unique<AudioFrame>(); auto frame = std::make_unique<AudioFrame>();
const auto ret = decoder_->decode(*frame); const auto ret = decoder_->decode(*frame);
const auto inFmt = AudioFormat((unsigned)frame->pointer()->sample_rate, (unsigned)frame->pointer()->channels, (AVSampleFormat)frame->pointer()->format);
switch(ret) { switch(ret) {
case MediaDecoder::Status::ReadError: case MediaDecoder::Status::ReadError:
case MediaDecoder::Status::DecodeError: case MediaDecoder::Status::DecodeError:
......
...@@ -231,7 +231,7 @@ JackLayer::JackLayer(const AudioPreference &p) : ...@@ -231,7 +231,7 @@ JackLayer::JackLayer(const AudioPreference &p) :
const auto playRate = jack_get_sample_rate(playbackClient_); const auto playRate = jack_get_sample_rate(playbackClient_);
const auto captureRate = jack_get_sample_rate(captureClient_); const auto captureRate = jack_get_sample_rate(captureClient_);
audioInputFormat_ = {captureRate, in_ringbuffers_.size()}; audioInputFormat_ = {captureRate, (unsigned)in_ringbuffers_.size()};
hardwareFormatAvailable(AudioFormat(playRate, out_ringbuffers_.size())); hardwareFormatAvailable(AudioFormat(playRate, out_ringbuffers_.size()));
hardwareInputFormatAvailable(audioInputFormat_); hardwareInputFormatAvailable(audioInputFormat_);
jack_on_shutdown(playbackClient_, onShutdown, this); jack_on_shutdown(playbackClient_, onShutdown, this);
......
...@@ -39,13 +39,13 @@ namespace ring { ...@@ -39,13 +39,13 @@ namespace ring {
// corresponds to 160 ms (about 5 rtp packets) // corresponds to 160 ms (about 5 rtp packets)
static const size_t MIN_BUFFER_SIZE = 1024; static const size_t MIN_BUFFER_SIZE = 1024;
RingBuffer::RingBuffer(const std::string& rbuf_id, size_t size, AudioFormat format) RingBuffer::RingBuffer(const std::string& rbuf_id, size_t /*size*/, AudioFormat format)
: id(rbuf_id) : id(rbuf_id)
, endPos_(0) , endPos_(0)
, format_(format)
, lock_() , lock_()
, not_empty_() , not_empty_()
, readoffsets_() , readoffsets_()
, format_(format)
, resizer_(format_, format_.sample_rate / 50, [this](std::shared_ptr<AudioFrame>&& frame){ , resizer_(format_, format_.sample_rate / 50, [this](std::shared_ptr<AudioFrame>&& frame){
putToBuffer(std::move(frame)); putToBuffer(std::move(frame));
}) })
...@@ -121,7 +121,7 @@ RingBuffer::createReadOffset(const std::string &call_id) ...@@ -121,7 +121,7 @@ RingBuffer::createReadOffset(const std::string &call_id)
{ {
std::lock_guard<std::mutex> l(lock_); std::lock_guard<std::mutex> l(lock_);
if (!hasThisReadOffset(call_id)) if (!hasThisReadOffset(call_id))
readoffsets_.emplace(call_id, ReadOffset {endPos_}); readoffsets_.emplace(call_id, ReadOffset {endPos_, {}});
} }
......
...@@ -271,7 +271,6 @@ RingBufferPool::getData(const std::string& call_id) ...@@ -271,7 +271,6 @@ RingBufferPool::getData(const std::string& call_id)
if (bindings->size() == 1) if (bindings->size() == 1)
return (*bindings->cbegin())->get(call_id); return (*bindings->cbegin())->get(call_id);
size_t size = 0;
auto mixBuffer = std::make_unique<AudioFrame>(internalAudioFormat_); auto mixBuffer = std::make_unique<AudioFrame>(internalAudioFormat_);
for (const auto& rbuf : *bindings) { for (const auto& rbuf : *bindings) {
if (auto b = rbuf->get(call_id)) { if (auto b = rbuf->get(call_id)) {
......
...@@ -216,8 +216,12 @@ MediaFilter::readOutput() ...@@ -216,8 +216,12 @@ MediaFilter::readOutput()
void void
MediaFilter::flush() MediaFilter::flush()
{ {
for (size_t i = 0; i < inputs_.size(); ++i) for (size_t i = 0; i < inputs_.size(); ++i) {
av_buffersrc_add_frame_flags(inputs_[i], nullptr, 0); int ret = av_buffersrc_add_frame_flags(inputs_[i], nullptr, 0);
if (ret < 0) {
RING_ERR() << "Failed to flush filter '" << inputParams_[i].name << "': " << libav_utils::getError(ret);
}
}
} }
int int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment