summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-04-13 09:56:45 +0200
committerMax Kellermann <max@duempel.org>2016-04-13 10:03:40 +0200
commit33fdaa5b6d66a9a296e8ba170098b10f24be523b (patch)
tree943670c7e6001adf109da0dca1ab31f8e6c15686 /src/decoder
parent6a1f5667f95f99c4f4457f370abb10172fa7751e (diff)
parent70495aada1a1e655b24173ca77d20c71af0dbc8c (diff)
Merge branch 'v0.19.x'
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/DecoderThread.cxx4
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx9
2 files changed, 11 insertions, 2 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index 0378b803f..f7aafa00f 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -236,7 +236,11 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
{
const struct DecoderPlugin *plugin;
+#ifdef HAVE_FFMPEG
+ plugin = decoder_plugin_from_name("ffmpeg");
+#else
plugin = decoder_plugin_from_name("mad");
+#endif
return plugin != nullptr && plugin->stream_decode != nullptr &&
decoder_stream_decode(*plugin, decoder, is);
}
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 6bb3c3c9d..5d7767500 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -185,7 +185,7 @@ PtsToPcmFrame(uint64_t pts, const AVStream &stream,
*/
static DecoderCommand
ffmpeg_send_packet(Decoder &decoder, InputStream &is,
- AVPacket packet,
+ AVPacket &&packet,
AVCodecContext &codec_context,
const AVStream &stream,
AVFrame &frame,
@@ -560,7 +560,8 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
if (packet.stream_index == audio_stream) {
cmd = ffmpeg_send_packet(decoder, input,
- packet, codec_context,
+ std::move(packet),
+ codec_context,
av_stream,
*frame,
min_frame, audio_format.GetFrameSize(),
@@ -569,7 +570,11 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
} else
cmd = decoder_get_command(decoder);
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 25, 100)
+ av_packet_unref(&packet);
+#else
av_free_packet(&packet);
+#endif
}
#if LIBAVUTIL_VERSION_MAJOR >= 53