diff --git a/NEWS b/NEWS index 2e526a841..5470a208c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.19.18 (not yet released) * decoder + - ffmpeg: fix crash with older FFmpeg versions (< 3.0) - ffmpeg: log detailed error message ver 0.19.17 (2016/07/09) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 95aa2905d..5d3ccb3fa 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -419,6 +419,24 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, return cmd; } +static DecoderCommand +ffmpeg_send_packet(Decoder &decoder, InputStream &is, + const AVPacket &packet, + AVCodecContext &codec_context, + const AVStream &stream, + AVFrame *frame, + uint64_t min_frame, size_t pcm_frame_size, + FfmpegBuffer &buffer) +{ + return ffmpeg_send_packet(decoder, is, + /* copy the AVPacket, because FFmpeg + < 3.0 requires this */ + AVPacket(packet), + codec_context, stream, + frame, min_frame, pcm_frame_size, + buffer); +} + gcc_const static SampleFormat ffmpeg_sample_format(enum AVSampleFormat sample_fmt) @@ -627,7 +645,7 @@ ffmpeg_decode(Decoder &decoder, InputStream &input) if (packet.stream_index == audio_stream) { cmd = ffmpeg_send_packet(decoder, input, - std::move(packet), + packet, *codec_context, *av_stream, frame,