tags 638242 patch
user ubuntu-de...@lists.ubuntu.com
usertags 638242 ubuntu-patch oneiric
thanks

On Wed, Aug 17, 2011 at 11:06:10PM +0200, Moritz Muehlenhoff wrote:
> Your package currently fails to build from source when built against
> libav/0.7.2 and needs to be adapted. You can test this yourself by
> building against the packages from experimental:

Here's a patch:

  * Port to libav 0.7 API.

diff -u smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/ffmpeg2raw.c 
smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/ffmpeg2raw.c
--- smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/ffmpeg2raw.c
+++ smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/ffmpeg2raw.c
@@ -141,11 +141,11 @@
         AVCodecContext *enc = this->context->streams[ i ]->codec;
         switch( enc->codec_type ) 
                {
-               case CODEC_TYPE_VIDEO:
+               case AVMEDIA_TYPE_VIDEO:
                if ( this->video_index < 0 )
                        this->video_index = i;
                break;
-               case CODEC_TYPE_AUDIO:
+               case AVMEDIA_TYPE_AUDIO:
                if ( this->audio_index < 0 && !this->disable_audio )
                        this->audio_index = i;
                break;
@@ -175,8 +175,10 @@
                if ( this->channels != aenc->channels && aenc->codec_id == 
CODEC_ID_AC3)
                        aenc->channels = this->channels;
                if ( acodec != NULL && avcodec_open( aenc, acodec ) >= 0 )
-                       resample = audio_resample_init( this->channels, 
aenc->channels, 
-                                                                               
        this->frequency, aenc->sample_rate);
+                       resample = av_audio_resample_init( this->channels, 
aenc->channels, 
+                                                                               
           this->frequency, aenc->sample_rate,
+                                                                               
           AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
+                                                                               
           16, 10, 0, 0.8);
                else
                        this->audio_index = -1;
        }
@@ -188,10 +190,8 @@
                AVFrame real_frame;
                AVFrame *frame = &real_frame;
                AVFrame *output = alloc_picture( PIX_FMT_RGB24, 
vstream->codec->width, vstream->codec->height );
-               int len;
                int len1;
                int got_picture;
-               uint8_t *ptr;
                double multiplier = ( this->pal ? 25.00 : 29.97 ) / fps;
                int16_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 4) ]; 
                int16_t resampled[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 4) ]; 
@@ -224,12 +224,9 @@
                {
                        ret = av_read_frame( this->context, &pkt );
 
-                       ptr = pkt.data;
-                       len = pkt.size;
-
                        if ( ret >=0 && pkt.stream_index == this->video_index )
                        {
-                               if ( len == 0 && this->nodupe == 0 && !first )
+                               if ( pkt.size == 0 && this->nodupe == 0 && 
!first )
                                {
                                        if ( dvframes_add_video( NULL, 
venc->width, venc->height, 0 ) )
                                        {
@@ -239,9 +236,9 @@
                                        }
                                }
 
-                               while ( len > 0 )
+                               while ( pkt.size > 0 )
                                {
-                                       len1 = avcodec_decode_video( 
vstream->codec, frame, &got_picture, ptr, len);
+                                       len1 = avcodec_decode_video2( 
vstream->codec, frame, &got_picture, &pkt);
                                        if ( len1 < 0 )
                                                break;
                                        if ( got_picture )
@@ -250,7 +247,7 @@
                                                //if ( video_pts > 0 )
                                                        //fprintf( stderr, 
"video_pts = %f\n", video_pts );
 
-                                               sws_scale( sws, 
((AVPicture*)frame)->data, ((AVPicture*)frame)->linesize,
+                                               sws_scale( sws, (const uint8_t 
* const *) ((AVPicture*)frame)->data, ((AVPicture*)frame)->linesize,
                                                           0, venc->height,
                                                           
((AVPicture*)output)->data, ((AVPicture*)output)->linesize );
 
@@ -263,20 +260,20 @@
                                                        break;
                                                }
                                        }
-                                       ptr += len1;
-                                       len -= len1;
+                                       pkt.data += len1;
+                                       pkt.size -= len1;
                                }
                        }
                        else if ( ret >=0 && pkt.stream_index == 
this->audio_index )
                        {
                                int data_size;
 
-                               while ( len > 0 )
+                               while ( pkt.size > 0 )
                                {
                                        data_size = sizeof(audio_buf);
-                       len1 = avcodec_decode_audio2(astream->codec, audio_buf, 
&data_size, ptr, len );
-                                       len -= len1;
-                                       ptr += len1;
+                       len1 = avcodec_decode_audio3(astream->codec, audio_buf, 
&data_size, &pkt );
+                                       pkt.size -= len1;
+                                       pkt.data += len1;
                                        if ( data_size > 0 )
                                        {
                                        int size_out = audio_resample( 
resample, resampled, audio_buf, 
@@ -352,7 +349,7 @@
                AVCodecContext *enc = st->codec;
                AVCodec *p = avcodec_find_decoder(enc->codec_id);
                if ( p )
-               printf("%c%d: %s\n", enc->codec_type == CODEC_TYPE_VIDEO ? 'V' 
: 'A', i, p->name );
+               printf("%c%d: %s\n", enc->codec_type == AVMEDIA_TYPE_VIDEO ? 
'V' : 'A', i, p->name );
     }
 }
 
@@ -438,13 +435,13 @@
                        convert->disable_audio = 1;
                else if ( !strcmp( argv[ i ], "-r" ) )
                        convert->fps = atof( argv[ ++ i ] );
-               else if ( av_open_input_file( &convert->context, argv[ i ], 
NULL, 0, NULL ) >= 0 )
+               else if ( avformat_open_input( &convert->context, argv[ i ], 
NULL, NULL ) >= 0 )
                {
                        if ( av_find_stream_info( convert->context ) >= 0 )
                        {
                                if ( !stats )
                                {
-                                       dump_format( convert->context, 0, argv[ 
i ], 0 );
+                                       av_dump_format( convert->context, 0, 
argv[ i ], 0 );
                                        ff2raw_output( convert );
                                        convert->audio_index = 
convert->video_index = -1;
                                }
diff -u smilutils-0.3.2+cvs20070731/debian/control 
smilutils-0.3.2+cvs20070731/debian/control
--- smilutils-0.3.2+cvs20070731/debian/control
+++ smilutils-0.3.2+cvs20070731/debian/control
@@ -4,7 +4,7 @@
 Maintainer: Roland Mas <lola...@debian.org>
 Uploaders: Paul Brossier <p...@debian.org>
 Standards-Version: 3.7.3
-Build-Depends: debhelper (>= 5), libquicktime-dev, libswscale-dev, libdv4-dev, 
libglib2.0-dev, libxml2-dev, libimlib2-dev, libsdl1.2-dev, autotools-dev, 
libltdl3-dev, ffmpeg, libavcodec-dev, libavformat-dev, libtool, libvorbis-dev, 
libogg-dev, libdts-dev, libgtk2.0-dev, autoconf, automake
+Build-Depends: debhelper (>= 5), libquicktime-dev, libswscale-dev (>= 4:0.6), 
libdv4-dev, libglib2.0-dev, libxml2-dev, libimlib2-dev, libsdl1.2-dev, 
autotools-dev, libltdl3-dev, ffmpeg, libavcodec-dev (>= 4:0.6), libavformat-dev 
(>= 4:0.7), libtool, libvorbis-dev, libogg-dev, libdts-dev, libgtk2.0-dev, 
autoconf, automake
 
 Package: smilutils
 Architecture: any

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to