diff -Nru k9copy-2.3.8-Source/src/import/k9avidecode.cpp k9copy-2.3.8-Source-Good/src/import/k9avidecode.cpp --- k9copy-2.3.8-Source/src/import/k9avidecode.cpp 2011-12-09 22:08:41.000000000 +0100 +++ k9copy-2.3.8-Source-Good/src/import/k9avidecode.cpp 2013-04-08 03:02:23.356566032 +0200 @@ -38,10 +38,12 @@ CodecHandle=0; FormatHandle=0; SwscaleHandle=0; + UtilHandle=0; glibref=0; if (glibref==0) { CodecHandle=dlopen("libavcodec.so",RTLD_LAZY ); //| RTLD_GLOBAL FormatHandle=dlopen("libavformat.so",RTLD_LAZY); + UtilHandle=dlopen("libavutil.so",RTLD_LAZY); #ifdef HAVE_SWSCALE SwscaleHandle=dlopen("libswscale.so",RTLD_LAZY); if (SwscaleHandle==0) @@ -56,6 +58,9 @@ if (!FormatHandle ) { errs << i18n("Cannot open the library %1").arg("libavformat"); } + if (!UtilHandle ) { + errs << i18n("Cannot open the library %1").arg("libavutil"); + } #ifdef HAVE_SWSCALE if (!SwscaleHandle) { errs << i18n("Cannot open the library %1").arg("libswscale"); @@ -63,17 +68,16 @@ #endif av_register_all = (av_register_all_t)dlsym(FormatHandle,"av_register_all"); - av_open_input_file = (av_open_input_file_t)dlsym(FormatHandle,"av_open_input_file"); - av_find_stream_info = (av_find_stream_info_t)dlsym(FormatHandle,"av_find_stream_info"); + avformat_open_input = (avformat_open_input_t)dlsym(FormatHandle,"avformat_open_input"); + avformat_find_stream_info = (avformat_find_stream_info_t)dlsym(FormatHandle,"avformat_find_stream_info"); avcodec_find_decoder =(avcodec_find_decoder_t) dlsym(CodecHandle,"avcodec_find_decoder"); - avcodec_open = (avcodec_open_t)dlsym(CodecHandle,"avcodec_open"); + avcodec_open2 = (avcodec_open2_t)dlsym(CodecHandle,"avcodec_open2"); avcodec_alloc_frame = (avcodec_alloc_frame_t)dlsym(CodecHandle,"avcodec_alloc_frame"); avpicture_get_size = (avpicture_get_size_t)dlsym(CodecHandle,"avpicture_get_size"); av_malloc = (av_malloc_t)dlsym(CodecHandle,"av_malloc"); avpicture_fill = (avpicture_fill_t)dlsym(CodecHandle,"avpicture_fill"); av_read_frame = (av_read_frame_t)dlsym(FormatHandle,"av_read_frame"); - avcodec_decode_video = (avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video"); - if (avcodec_decode_video==0) avcodec_decode_video=(avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video2"); + avcodec_decode_video2 = (avcodec_decode_video2_t)dlsym(CodecHandle,"avcodec_decode_video2"); #ifndef HAVE_SWSCALE img_convert = (img_convert_t)dlsym(CodecHandle,"img_convert"); //if img_convert is null (deprecated in ffmpeg), we need libswscale @@ -85,7 +89,7 @@ if (av_free_packet==0) av_free_packet=av_free_packet_internal; avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close"); - av_close_input_file = (av_close_input_file_t)dlsym(FormatHandle,"av_close_input_file"); + avformat_close_input = (avformat_close_input_t)dlsym(FormatHandle,"avformat_close_input"); av_seek_frame=(av_seek_frame_t)dlsym(FormatHandle,"av_seek_frame"); av_rescale_q=(av_rescale_q_t)dlsym(FormatHandle,"av_rescale_q"); avcodec_flush_buffers=(avcodec_flush_buffers_t)dlsym(CodecHandle,"avcodec_flush_buffers"); @@ -94,7 +98,8 @@ sws_getContext=(sws_getContext_t)dlsym(SwscaleHandle,"sws_getContext"); sws_scale= (sws_scale_t)dlsym(SwscaleHandle,"sws_scale"); #endif - av_gettime=(av_gettime_t)dlsym(FormatHandle,"av_gettime"); + av_gettime=(av_gettime_t)dlsym(UtilHandle,"av_gettime"); + avio_rb64=(avio_rb64_t)dlsym(FormatHandle,"avio_rb64"); if (errs.count() >0) { m_error=errs.join("\n"); @@ -114,6 +119,8 @@ close(); glibref--; if (glibref==0) { + if (UtilHandle) + dlclose(UtilHandle); if (FormatHandle) dlclose(FormatHandle); if (CodecHandle) @@ -134,12 +141,12 @@ close(); // Open video file - if (av_open_input_file(&m_FormatCtx, _fileName.toUtf8(), NULL, 0, NULL)!=0) { + if (avformat_open_input(&m_FormatCtx, _fileName.toUtf8(), 0, 0)!=0) { m_error=i18n("Couldn't open the file %1").arg(_fileName); return false; // Couldn't open file} } // Retrieve stream information - if (av_find_stream_info(m_FormatCtx)<0) { + if (avformat_find_stream_info(m_FormatCtx, NULL)<0) { m_error =i18n("Couldn't find stream information"); return false; // Couldn't find stream information } @@ -168,7 +175,7 @@ return false; // Codec not found } // Open codec - if (avcodec_open(m_CodecCtx, m_Codec)<0) { + if (avcodec_open2(m_CodecCtx, m_Codec, NULL)<0) { m_error =i18n("Could'nt open the codec"); return false; // Could not open codec } @@ -245,15 +252,15 @@ // Is this a packet from the video stream? if (packet.stream_index==m_videoStream) { // Decode video frame - avcodec_decode_video(m_CodecCtx, m_Frame, &frameFinished, - packet.data, packet.size); + avcodec_decode_video2(m_CodecCtx, m_Frame, &frameFinished, &packet); // Did we get a video frame? if (frameFinished) { // if (m_Frame->pts >=fspos) int64_t cur_dts=fspos; - if (m_FormatCtx->cur_st) - cur_dts= m_FormatCtx->cur_st->cur_dts; + cur_dts=packet.dts; + if (m_FormatCtx->pb) + cur_dts=avio_rb64(m_FormatCtx->pb); if (cur_dts >=fspos) { bFound=true; #ifndef HAVE_SWSCALE @@ -309,7 +316,7 @@ avcodec_close(m_CodecCtx); // Close the video file - av_close_input_file(m_FormatCtx); + avformat_close_input(&m_FormatCtx); m_opened=false; } } Les fichiers binaires k9copy-2.3.8-Source/src/import/.k9avidecode.cpp.swp et k9copy-2.3.8-Source-Good/src/import/.k9avidecode.cpp.swp sont différents diff -Nru k9copy-2.3.8-Source/src/import/k9avidecode.h k9copy-2.3.8-Source-Good/src/import/k9avidecode.h --- k9copy-2.3.8-Source/src/import/k9avidecode.h 2011-12-09 22:08:41.000000000 +0100 +++ k9copy-2.3.8-Source-Good/src/import/k9avidecode.h 2013-04-08 02:57:59.967557588 +0200 @@ -29,10 +29,10 @@ //typedef dvd_file_t * (*DVDOpenFile_t) ( dvd_reader_t *, int, dvd_read_domain_t ); typedef void (*av_register_all_t) (void); typedef int64_t (*av_gettime_t) (void); -typedef int (*av_open_input_file_t)(AVFormatContext **, const char *,AVInputFormat *,int, AVFormatParameters *); -typedef int (*av_find_stream_info_t)(AVFormatContext *); +typedef int (*avformat_open_input_t)(AVFormatContext **, const char *,AVInputFormat *,AVDictionary **); +typedef int (*avformat_find_stream_info_t)(AVFormatContext *, AVDictionary **); typedef AVCodec* (*avcodec_find_decoder_t)(enum CodecID); -typedef int (*avcodec_open_t)(AVCodecContext *, AVCodec *); +typedef int (*avcodec_open2_t)(AVCodecContext *, AVCodec *, AVDictionary **); typedef AVFrame * (*avcodec_alloc_frame_t)(void); typedef int (*avpicture_get_size_t)(int , int , int ); @@ -40,14 +40,15 @@ typedef int (*avpicture_fill_t)(AVPicture *, uint8_t *,int , int , int); typedef int (*av_read_frame_t)(AVFormatContext *, AVPacket *); -typedef int (*avcodec_decode_video_t)(AVCodecContext *, AVFrame *,int *, uint8_t *, int ); +typedef int (*avcodec_decode_video2_t)(AVCodecContext *, AVFrame *,int *, AVPacket *); typedef int (*img_convert_t)(AVPicture *, int , const AVPicture *, int ,int, int); typedef void (*av_free_t)(void *); typedef int (*avcodec_close_t)(AVCodecContext *); -typedef void (*av_close_input_file_t)(AVFormatContext *); +typedef void (*avformat_close_input_t)(AVFormatContext **); typedef int (*av_seek_frame_t)(AVFormatContext *,int,int64_t timestamp,int flags); typedef int64_t (*av_rescale_q_t)(int64_t , AVRational , AVRational ) ; typedef void (*avcodec_flush_buffers_t)(AVCodecContext *); typedef void (*av_free_packet_t)(AVPacket *); +typedef uint64_t (*avio_rb64_t)(AVIOContext *s); #ifdef HAVE_SWSCALE typedef void (*sws_freeContext_t)(struct SwsContext *swsContext); @@ -77,23 +78,24 @@ private: av_register_all_t av_register_all; - av_open_input_file_t av_open_input_file; - av_find_stream_info_t av_find_stream_info; + avformat_open_input_t avformat_open_input; + avformat_find_stream_info_t avformat_find_stream_info; avcodec_find_decoder_t avcodec_find_decoder; - avcodec_open_t avcodec_open; + avcodec_open2_t avcodec_open2; avcodec_alloc_frame_t avcodec_alloc_frame; av_seek_frame_t av_seek_frame; avpicture_get_size_t avpicture_get_size; av_malloc_t av_malloc; avpicture_fill_t avpicture_fill; av_read_frame_t av_read_frame; - avcodec_decode_video_t avcodec_decode_video; + avcodec_decode_video2_t avcodec_decode_video2; img_convert_t img_convert; av_free_t av_free; avcodec_close_t avcodec_close; - av_close_input_file_t av_close_input_file; + avformat_close_input_t avformat_close_input; av_rescale_q_t av_rescale_q; av_gettime_t av_gettime; + avio_rb64_t avio_rb64; avcodec_flush_buffers_t avcodec_flush_buffers; av_free_packet_t av_free_packet; #ifdef HAVE_SWSCALE @@ -103,6 +105,7 @@ #endif void *CodecHandle; void *FormatHandle; + void *UtilHandle; void *SwscaleHandle; int glibref; Les fichiers binaires k9copy-2.3.8-Source/src/import/.k9avidecode.h.swp et k9copy-2.3.8-Source-Good/src/import/.k9avidecode.h.swp sont différents