From c1a4fb079ab772798cb068003da414ba1100f687 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 16 Dec 2012 09:21:51 +0000 Subject: ffmpeg plugin: fixed streams support git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3072 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp') 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); -- cgit v1.2.3-13-gbd6f