[GRASS-SVN] r56627 - grass/branches/develbranch_6/lib/ogsf

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 7 02:09:10 PDT 2013


Author: hamish
Date: 2013-06-07 02:09:10 -0700 (Fri, 07 Jun 2013)
New Revision: 56627

Modified:
   grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c
Log:
tweaks to get it working on Ubuntu/10.04 (#1423)

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c	2013-06-07 08:46:31 UTC (rev 56626)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c	2013-06-07 09:09:10 UTC (rev 56627)
@@ -64,7 +64,7 @@
     AVCodecContext *c;
     AVStream *st;
 
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 0, 0)
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 112, 0)
     st = av_new_stream(oc, 0);
 #else
     st = avformat_new_stream(oc, NULL);
@@ -76,7 +76,11 @@
 
     c = st->codec;
     c->codec_id = codec_id;
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 123, 0)
+    c->codec_type = CODEC_TYPE_VIDEO;
+#else
     c->codec_type = AVMEDIA_TYPE_VIDEO;
+#endif
 
     /* put sample parameters */
     c->bit_rate = 400000;
@@ -234,8 +238,11 @@
 	AVPacket pkt;
 
 	av_init_packet(&pkt);
-
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 32, 0)
+	pkt.flags |= PKT_FLAG_KEY;
+#else
 	pkt.flags |= AV_PKT_FLAG_KEY;
+#endif
 	pkt.stream_index = st->index;
 	pkt.data = (uint8_t *) picture;
 	pkt.size = sizeof(AVPicture);
@@ -321,7 +328,11 @@
     av_register_all();
 
     /* auto detect the output format from the name. default is mpeg. */
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 32, 0)
+    fmt = guess_format(NULL, filename, NULL);
+#else
     fmt = av_guess_format(NULL, filename, NULL);
+#endif
     if (!fmt) {
 	G_warning(_("Unable to deduce output format from file extension: using MPEG"));
 	fmt = av_guess_format("mpeg", NULL, NULL);
@@ -375,7 +386,7 @@
 
     /* open the output file, if needed */
     if (!(fmt->flags & AVFMT_NOFILE)) {
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 0, 0)
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 112, 0)
         if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) { 
 #else
 	if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {



More information about the grass-commit mailing list