summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-07-27 21:47:26 +0200
committerCarl Hetherington <cth@carlh.net>2020-07-27 21:47:26 +0200
commit2da4caba7871455c097c0ed940dd6f2332dbda5d (patch)
treef87883d0fcfe4c19ae5f7490306d49cc4f5d02b3 /src/lib/ffmpeg_decoder.cc
parent94aadbd62c259a73d7511522dd167d519c68c5f9 (diff)
parent5d440e1133fc68dfffeaf53cf934b996dae811c7 (diff)
Merge branch 'warnings' into v2.15.x.
Clean up our handling of compiler warnings in a variety of ways, and use #pragma rather than -Wno to only disable warnings where necessary.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index cfaf0361b..04c97ed3b 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -206,9 +206,11 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream) const
{
DCPOMATIC_ASSERT (bytes_per_audio_sample (stream));
+DCPOMATIC_DISABLE_WARNINGS
int const size = av_samples_get_buffer_size (
0, stream->stream(_format_context)->codec->channels, _frame->nb_samples, audio_sample_format (stream), 1
);
+DCPOMATIC_ENABLE_WARNINGS
/* XXX: can't we just use _frame->nb_samples directly here? */
/* XXX: can't we use swr_convert() to do the format conversion? */
@@ -339,7 +341,9 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream) const
AVSampleFormat
FFmpegDecoder::audio_sample_format (shared_ptr<FFmpegAudioStream> stream) const
{
+DCPOMATIC_DISABLE_WARNINGS
return stream->stream (_format_context)->codec->sample_fmt;
+DCPOMATIC_ENABLE_WARNINGS
}
int
@@ -401,9 +405,11 @@ FFmpegDecoder::seek (ContentTime time, bool accurate)
avcodec_flush_buffers (video_codec_context());
}
+DCPOMATIC_DISABLE_WARNINGS
BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, ffmpeg_content()->ffmpeg_audio_streams()) {
avcodec_flush_buffers (i->stream(_format_context)->codec);
}
+DCPOMATIC_ENABLE_WARNINGS
if (subtitle_codec_context ()) {
avcodec_flush_buffers (subtitle_codec_context ());
@@ -434,6 +440,7 @@ FFmpegDecoder::decode_audio_packet ()
return;
}
+DCPOMATIC_DISABLE_WARNINGS
while (copy_packet.size > 0) {
int frame_finished;
@@ -493,6 +500,7 @@ FFmpegDecoder::decode_audio_packet ()
to_string(_pts_offset)
);
}
+DCPOMATIC_ENABLE_WARNINGS
/* Give this data provided there is some, and its time is sane */
if (ct >= ContentTime() && data->frames() > 0) {
@@ -511,9 +519,11 @@ FFmpegDecoder::decode_video_packet ()
DCPOMATIC_ASSERT (_video_stream);
int frame_finished;
+DCPOMATIC_DISABLE_WARNINGS
if (avcodec_decode_video2 (video_codec_context(), _frame, &frame_finished, &_packet) < 0 || !frame_finished) {
return false;
}
+DCPOMATIC_ENABLE_WARNINGS
boost::mutex::scoped_lock lm (_filter_graphs_mutex);