commit 75eff0dd705d5afda3d39fa1ba9eb140b571b662 Author: elupus Date: Sat Sep 10 17:27:15 2011 +0200 replace depreciated av_open_input_stream/file with new avformat_open_input diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h index 0563486..9008cab 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h @@ -74,9 +74,8 @@ public: #if (!defined USE_EXTERNAL_FFMPEG) virtual int av_find_stream_info_dont_call(AVFormatContext *ic)=0; #endif - virtual int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, int buf_size, AVFormatParameters *ap)=0; virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)=0; - virtual int av_open_input_stream(AVFormatContext **ic_ptr, ByteIOContext *pb, const char *filename, AVInputFormat *fmt, AVFormatParameters *ap)=0; + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), @@ -145,9 +144,9 @@ public: CSingleLock lock(DllAvCodec::m_critSection); return ::av_find_stream_info(ic); } - virtual int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, int buf_size, AVFormatParameters *ap) { return ::av_open_input_file(ic_ptr, filename, fmt, buf_size, ap); } virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } - virtual int av_open_input_stream(AVFormatContext **ic_ptr, ByteIOContext *pb, const char *filename, AVInputFormat *fmt, AVFormatParameters *ap) { return ::av_open_input_stream(ic_ptr, pb, filename, fmt, ap); } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) + { return ::avformat_open_input(ps, filename, fmt, opt, ap); } virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), @@ -228,8 +227,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface DEFINE_FUNC_ALIGNED2(int, __cdecl, av_read_frame, AVFormatContext *, AVPacket *) DEFINE_FUNC_ALIGNED4(int, __cdecl, av_seek_frame, AVFormatContext*, int, int64_t, int) DEFINE_FUNC_ALIGNED1(int, __cdecl, av_find_stream_info_dont_call, AVFormatContext*) - DEFINE_FUNC_ALIGNED5(int, __cdecl, av_open_input_file, AVFormatContext**, const char *, AVInputFormat *, int, AVFormatParameters *) - DEFINE_FUNC_ALIGNED5(int,__cdecl, av_open_input_stream, AVFormatContext **, ByteIOContext *, const char *, AVInputFormat *, AVFormatParameters *) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avformat_open_input, AVFormatContext **, const char *, AVInputFormat *, AVDictionary **) DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int) DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*) DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, ByteIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int) @@ -281,9 +279,8 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface RESOLVE_METHOD(av_read_frame_flush) RESOLVE_METHOD(av_seek_frame) RESOLVE_METHOD_RENAME(av_find_stream_info, av_find_stream_info_dont_call) - RESOLVE_METHOD(av_open_input_file) RESOLVE_METHOD(url_set_interrupt_cb) - RESOLVE_METHOD(av_open_input_stream) + RESOLVE_METHOD(avformat_open_input) RESOLVE_METHOD(init_put_byte) RESOLVE_METHOD(av_probe_input_format) RESOLVE_METHOD(av_probe_input_format2) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp index 46287a8..f0ce468 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -284,14 +284,14 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) // try mmsh, then mmst CStdString strFile2; strFile2.Format("mmsh://%s",strFile.substr(6,strFile.size()-6).c_str()); - result = m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile2.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL); + result = m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile2.c_str(), iformat, NULL); if (result < 0) { strFile = "mmst://"; strFile += strFile2.Mid(7).c_str(); } } - if (result < 0 && m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL) < 0 ) + if (result < 0 && m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile.c_str(), iformat, NULL) < 0 ) { CLog::Log(LOGDEBUG, "Error, could not open file %s", strFile.c_str()); Dispose(); @@ -424,7 +424,10 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) // open the demuxer - if (m_dllAvFormat.av_open_input_stream(&m_pFormatContext, m_ioContext, strFile.c_str(), iformat, NULL) < 0) + m_pFormatContext = m_dllAvFormat.avformat_alloc_context(); + m_pFormatContext->pb = m_ioContext; + + if (m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile.c_str(), iformat, NULL) < 0) { CLog::Log(LOGERROR, "%s - Error, could not open file %s", __FUNCTION__, strFile.c_str()); Dispose();