aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-12-16 09:21:51 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-12-16 09:21:51 +0000
commitc1a4fb079ab772798cb068003da414ba1100f687 (patch)
tree14e0a885bc73d2e5fa3b02f65f6af5a07088c92b /src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
parent79c1241354dfadbf5afd8dca7e5ff4913aee5f6e (diff)
downloadqmmp-c1a4fb079ab772798cb068003da414ba1100f687.tar.gz
qmmp-c1a4fb079ab772798cb068003da414ba1100f687.tar.bz2
qmmp-c1a4fb079ab772798cb068003da414ba1100f687.zip
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
Diffstat (limited to 'src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp')
-rw-r--r--src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp9
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);