Fix another crash casued by old av_packet_free routine

pull/1/head
Timothy Pearson 10 years ago
parent effa31d902
commit 0e824732db

@ -40,7 +40,7 @@ int glibref=0;
#ifdef NEW_FFMPEG
#ifdef NEEDS_AV_FREE_PACKET
void av_free_packet(AVPacket *pkt)
void av_free_packet_internal(AVPacket *pkt)
{
if (pkt) {
if (pkt->destruct) pkt->destruct(pkt);
@ -121,6 +121,9 @@ k9AviDecode::k9AviDecode(TQObject *parent, const char *name)
errs << i18n("Cannot open the library %1").arg("libswscale");
# endif
av_free = (av_free_t)dlsym(CodecHandle,"av_free");
av_free_packet = (av_free_packet_t)dlsym(CodecHandle,"av_free_packet");
if (av_free_packet==0)
av_free_packet=av_free_packet_internal;
avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close");
# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
avformat_close_input = (avformat_close_input_t)dlsym(FormatHandle,"avformat_close_input");

@ -78,6 +78,7 @@ typedef void (*av_close_input_file_t)(AVFormatContext *);
#endif
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 *);
#ifdef HAVE_SWSCALE
typedef void (*sws_freeContext_t)(struct SwsContext *swsContext);
@ -145,6 +146,7 @@ private:
av_rescale_q_t av_rescale_q;
av_gettime_t av_gettime;
avcodec_flush_buffers_t avcodec_flush_buffers;
av_free_packet_t av_free_packet;
# ifdef HAVE_SWSCALE
sws_freeContext_t sws_freeContext;
sws_getContext_t sws_getContext;

@ -46,7 +46,8 @@ k9Copy::k9Copy()
: KMdiMainFrm( 0, "k9Copy" ,KMdi::IDEAlMode ) {
// tell the TDEMainWindow that this is indeed the main widget
m_k9MainView=NULL;
m_k9ImportView =NULL;
m_k9ImportView=NULL;
m_chapterEdit=NULL;
// accept dnd
setAcceptDrops(true);

Loading…
Cancel
Save