--- grass-6.4.2/configure.in.orig 2012-10-20 12:50:17.287207081 +0200 +++ grass-6.4.2/configure.in 2012-10-20 13:02:02.273844162 +0200 @@ -1125,7 +1125,7 @@ LOC_CHECK_LIB_PATH(ffmpeg, FFMPEG, FFMPEGLIBPATH) LOC_CHECK_LIBS(avutil, av_free, FFMPEG, $FFMPEGLIBPATH, FFMPEGLIB,,,,$MATHLIB) -LOC_CHECK_LIBS(avcodec, avcodec_init, FFMPEG, $FFMPEGLIBPATH, FFMPEGLIB, $FFMPEGLIB,,,$MATHLIB) -LOC_CHECK_LIBS(avformat, av_set_parameters, FFMPEG, $FFMPEGLIBPATH, FFMPEGLIB, $FFMPEGLIB,,,$MATHLIB) +LOC_CHECK_LIBS(avcodec, avcodec_register_all, FFMPEG, $FFMPEGLIBPATH, FFMPEGLIB, $FFMPEGLIB,,,$MATHLIB) +LOC_CHECK_LIBS(avformat, avformat_write_header, FFMPEG, $FFMPEGLIBPATH, FFMPEGLIB, $FFMPEGLIB,,,$MATHLIB) fi # $USE_FFMPEG --- grass-6.4.2/lib/ogsf/gsd_img_mpeg.c.orig 2009-01-12 08:46:29.000000000 +0100 +++ grass-6.4.2/lib/ogsf/gsd_img_mpeg.c 2012-10-21 11:07:46.300506016 +0200 @@ -66,7 +66,7 @@ c = st->codec; c->codec_id = codec_id; - c->codec_type = CODEC_TYPE_VIDEO; + c->codec_type = AVMEDIA_TYPE_VIDEO; /* put sample parameters */ c->bit_rate = 400000; @@ -97,7 +97,7 @@ c->flags |= CODEC_FLAG_GLOBAL_HEADER; c->flags |= CODEC_FLAG_QSCALE; - c->global_quality = st->quality = FF_QP2LAMBDA * 10; + c->global_quality = FF_QP2LAMBDA * 10; return st; } @@ -215,7 +215,7 @@ av_init_packet(&pkt); - pkt.flags |= PKT_FLAG_KEY; + pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = st->index; pkt.data = (uint8_t *) picture; pkt.size = sizeof(AVPicture); @@ -236,7 +236,7 @@ av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); if (c->coded_frame->key_frame) - pkt.flags |= PKT_FLAG_KEY; + pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = st->index; pkt.data = video_outbuf; pkt.size = out_size; @@ -301,10 +301,10 @@ av_register_all(); /* auto detect the output format from the name. default is mpeg. */ - fmt = guess_format(NULL, filename, NULL); + fmt = av_guess_format(NULL, filename, NULL); if (!fmt) { G_warning(_("Unable to deduce output format from file extension: using MPEG")); - fmt = guess_format("mpeg", NULL, NULL); + fmt = av_guess_format("mpeg", NULL, NULL); } if (!fmt) { G_warning(_("Unable to find suitable output format")); @@ -312,7 +312,7 @@ } /* allocate the output media context */ - oc = av_alloc_format_context(); + oc = avformat_alloc_context(); if (!oc) { G_warning(_("Out of memory")); return (-1); @@ -332,13 +332,7 @@ add_video_stream(oc, fmt->video_codec, (r - l + 1), (t - b + 1)); } - /* set the output parameters (must be done even if no parameters). */ - if (av_set_parameters(oc, NULL) < 0) { - G_warning(_("Invalid output format parameters")); - return (-1); - } - - dump_format(oc, 0, filename, 1); + av_dump_format(oc, 0, filename, 1); /* now that all the parameters are set, we can open the audio and video codecs and allocate the necessary encode buffers */ @@ -347,14 +341,14 @@ /* open the output file, if needed */ if (!(fmt->flags & AVFMT_NOFILE)) { - if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) { + if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) { G_warning(_("Unable to open <%s>"), filename); return (-1); } } /* write the stream header, if any */ - av_write_header(oc); + avformat_write_header(oc, NULL); #else @@ -436,11 +430,7 @@ if (!(fmt->flags & AVFMT_NOFILE)) { /* close the output file */ -#if (LIBAVFORMAT_VERSION_INT>>16) < 52 - url_fclose(&oc->pb); -#else - url_fclose(oc->pb); -#endif + avio_close(oc->pb); } /* free the stream */