diff options
Diffstat (limited to 'src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp')
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 03a0f6baf..2f630a35a 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -84,7 +84,7 @@ DecoderFFmpeg::~DecoderFFmpeg() m_bitrate = 0; m_temp_pkt.size = 0; if (ic) - avformat_close_input(&ic); + avformat_free_context(ic); if(m_pkt.data) av_free_packet(&m_pkt); if(m_stream) @@ -103,6 +103,8 @@ bool DecoderFFmpeg::initialize() avformat_network_init(); av_register_all(); + ic = avformat_alloc_context(); + AVProbeData pd; uint8_t buf[PROBE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; @@ -131,10 +133,11 @@ bool DecoderFFmpeg::initialize() } m_stream->seekable = !input()->isSequential(); m_stream->max_packet_size = INPUT_BUFFER_SIZE; + ic->pb = m_stream; - if(avformat_open_input(&ic, m_path.toLocal8Bit().constData(), fmt, 0) != 0) + if(avformat_open_input(&ic, 0, fmt, 0) != 0) { - qDebug("DecoderFFmpeg: av_open_input_stream() failed"); + qDebug("DecoderFFmpeg: avformat_open_input() failed"); return false; } avformat_find_stream_info(ic, 0); |
