diff -ruN softdevice/mpeg2decoder.c softdevice-2011.10.24//mpeg2decoder.c --- softdevice/mpeg2decoder.c 2011-04-17 19:22:18.000000000 +0200 +++ softdevice-2011.10.24//mpeg2decoder.c 2011-10-26 02:38:29.000000000 +0200 @@ -473,10 +473,14 @@ BUFDEB("start decode audio. pkt size: %d \n",size); #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(29<<8)+0) audio_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; - len=avcodec_decode_audio2(context, (short *)audiosamples, - &audio_size, data, size); + AVPacket packet; + av_init_packet(&packet); + packet.data = data; + packet.size = size; + len=avcodec_decode_audio3(context, (short *)audiosamples, + &audio_size, &packet); #else - len=avcodec_decode_audio(context, (short *)audiosamples, + len=avcodec_decode_audio2(context, (short *)audiosamples, &audio_size, data, size); #endif BUFDEB("end decode audio\n"); @@ -499,10 +503,14 @@ if (context->codec_id == CODEC_ID_AC3) { #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(29<<8)+0) audio_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; - len=avcodec_decode_audio2(context, (short *)audiosamples, - &audio_size, data, size); + AVPacket packet; + av_init_packet(&packet); + packet.data = data; + packet.size = size; + len=avcodec_decode_audio3(context, (short *)audiosamples, + &audio_size, &packet); #else - len=avcodec_decode_audio(context, (short *)audiosamples, + len=avcodec_decode_audio2(context, (short *)audiosamples, &audio_size, data, 1); #endif //fprintf(stderr,"2nd call len: %d a_size: %d\n", len, audio_size); @@ -575,8 +583,7 @@ int h=c->height; #if LIBAVCODEC_BUILD > 4737 - if(avcodec_check_dimensions(c,w,h)) - return -1; + avcodec_align_dimensions(c, &w, &h); #endif #if LIBAVCODEC_BUILD > 4713 @@ -717,7 +724,12 @@ return -1; }; - len = avcodec_decode_video(context, picture, &got_picture,data, length); + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = data; + avpkt.size = length; + avpkt.flags = AV_PKT_FLAG_KEY; + len = avcodec_decode_video2(context, picture, &got_picture, &avpkt); if (len < 0) return len; @@ -1311,14 +1323,14 @@ av_free_packet(&pkt); return; }; - int packet_type=CODEC_TYPE_UNKNOWN; + int packet_type=AVMEDIA_TYPE_UNKNOWN; #if LIBAVFORMAT_BUILD > 4628 if ( ic->streams[pkt.stream_index] && ic->streams[pkt.stream_index]->codec ) { packet_type = ic->streams[pkt.stream_index]->codec->codec_type; - if (packet_type == CODEC_TYPE_VIDEO && vout) + if (packet_type == AVMEDIA_TYPE_VIDEO && vout) vout->repeatFrame = ic->streams[pkt.stream_index]->parser->repeat_pict; } #else @@ -1326,13 +1338,13 @@ packet_type = ic->streams[pkt.stream_index]->codec.codec_type; #endif - if ( packet_type == CODEC_TYPE_UNKNOWN ) { + if ( packet_type == AVMEDIA_TYPE_UNKNOWN ) { BUFDEB("Unknown packet type! Return;\n"); return; }; // check if there are new streams - if ( AudioIdx != DONT_PLAY && packet_type == CODEC_TYPE_AUDIO + if ( AudioIdx != DONT_PLAY && packet_type == AVMEDIA_TYPE_AUDIO && AudioIdx != pkt.stream_index) { CMDDEB("new Audio stream index.. old %d new %d\n", AudioIdx,pkt.stream_index); @@ -1352,7 +1364,7 @@ #endif aoutMutex.Unlock(); } else - if (VideoIdx != DONT_PLAY && packet_type == CODEC_TYPE_VIDEO + if (VideoIdx != DONT_PLAY && packet_type == AVMEDIA_TYPE_VIDEO && VideoIdx!=pkt.stream_index) { CMDDEB("new Video stream index.. old %d new %d\n", VideoIdx,pkt.stream_index); @@ -1375,7 +1387,7 @@ // write streams voutMutex.Lock(); - if ( packet_type == CODEC_TYPE_VIDEO && vout ) { + if ( packet_type == AVMEDIA_TYPE_VIDEO && vout ) { BUFDEB("QueuePacket video stream\n"); while ( vout->PutPacket(pkt) == -1 && ThreadActive ) { // PutPacket sleeps is necessary @@ -1385,7 +1397,7 @@ voutMutex.Unlock(); aoutMutex.Lock(); - if ( packet_type == CODEC_TYPE_AUDIO && aout ) { + if ( packet_type == AVMEDIA_TYPE_AUDIO && aout ) { BUFDEB("QueuePacket audio stream\n"); while ( aout->PutPacket(pkt) == -1 && ThreadActive ) { // PutPacket sleeps is necessary @@ -1394,7 +1406,7 @@ }; aoutMutex.Unlock(); - if ( packet_type != CODEC_TYPE_VIDEO && packet_type != CODEC_TYPE_AUDIO ) { + if ( packet_type != AVMEDIA_TYPE_VIDEO && packet_type != AVMEDIA_TYPE_AUDIO ) { //printf("Unknown packet or vout or aout not init!!\n"); av_free_packet(&pkt); } diff -ruN softdevice/VideoFilter.h softdevice-2011.10.24//VideoFilter.h --- softdevice/VideoFilter.h 2008-02-26 09:06:18.000000000 +0100 +++ softdevice-2011.10.24//VideoFilter.h 2011-10-26 00:46:26.000000000 +0200 @@ -109,8 +109,8 @@ class cLibAvPostProc : public cVideoFilter { int width, height; PixelFormat pix_fmt; - pp_mode_t *ppmode; - pp_context_t *ppcontext; + pp_mode *ppmode; + pp_context *ppcontext; sPicBuffer *outBuf; int currentDeintMethod,currentppMethod,currentppQuality; public: