diff options
author | Max Kellermann <max@duempel.org> | 2014-12-18 23:24:11 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-18 23:24:11 +0100 |
commit | 13b954c76538f6204cc9b6b2c798113bd4722078 (patch) | |
tree | 1376de88206104e382637124e36f07a44f06a4ae /src | |
parent | 49f6b50ed3676e35ef25a208b7ada9aaa806d54d (diff) | |
download | mpd-13b954c76538f6204cc9b6b2c798113bd4722078.tar.gz mpd-13b954c76538f6204cc9b6b2c798113bd4722078.tar.xz mpd-13b954c76538f6204cc9b6b2c798113bd4722078.zip |
decoder/ffmpeg: pass AVPacket copy to ffmpeg_send_packet()
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 633be1565..35daa5bc3 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -307,7 +307,7 @@ copy_interleave_frame(const AVCodecContext &codec_context, static DecoderCommand ffmpeg_send_packet(Decoder &decoder, InputStream &is, - const AVPacket &packet, + AVPacket packet, AVCodecContext &codec_context, const AVStream &stream, AVFrame &frame, @@ -321,22 +321,20 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, stream.time_base)); } - AVPacket packet2 = packet; - DecoderCommand cmd = DecoderCommand::NONE; - while (packet2.size > 0 && cmd == DecoderCommand::NONE) { + while (packet.size > 0 && cmd == DecoderCommand::NONE) { int got_frame = 0; int len = avcodec_decode_audio4(&codec_context, &frame, &got_frame, - &packet2); + &packet); if (len < 0) { /* if error, we skip the frame */ LogFfmpegError(len, "decoding failed, frame skipped"); break; } - packet2.data += len; - packet2.size -= len; + packet.data += len; + packet.size -= len; if (!got_frame) continue; |