[GRASS-dev] error in lib/ogsf/gsd_img_mpeg.c

Hi & happy new year everybody,

after svn up, libogsf in develbranch_6 does not build:

gsd_img_mpeg.c: In function 'gsd_close_mpeg':
gsd_img_mpeg.c:439: error: incompatible type for argument 1 of 'url_fclose'
make[2]: *** [OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o] Error 1
make[2]: Leaving directory `/usr/local/src/grass/svn/grass64/lib/ogsf'

seems to be a result of this change:
  http://trac.osgeo.org/grass/changeset/35272
  "Fix bug (pass pointer, not its address) (merge from trunk, r35270)"

system is Debian/etch (aging-stable) on i686.
ffmpeg packages probably from the debian-multimedia repository.

?

thanks,
Hamish

On Mon, 12 Jan 2009, Hamish wrote:

Hi & happy new year everybody,

after svn up, libogsf in develbranch_6 does not build:

gsd_img_mpeg.c: In function 'gsd_close_mpeg':
gsd_img_mpeg.c:439: error: incompatible type for argument 1 of 'url_fclose'
make[2]: *** [OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o] Error 1
make[2]: Leaving directory `/usr/local/src/grass/svn/grass64/lib/ogsf'

seems to be a result of this change:
http://trac.osgeo.org/grass/changeset/35272
"Fix bug (pass pointer, not its address) (merge from trunk, r35270)"

Yes, although it's not a bugfix but a necessary change as the result of a change in the FFmpeg API, in November 2007:
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-November/037797.html
(Note the ominous comment "I believe this patch will break compability with most applications"!)

This change makes GRASS require an FFMPEG version newer than that -
I would guess a lot of distributions are using FFmpeg versions older than November 2007 though? Perhaps the call to url_fclose could be conditionalised on the version of libavformat, something like (untested):
#ifdef (LIBAVFORMAT_VERSION_INT>>16) < 52
   url_fclose(&oc->pb);
#else
   url_fclose(oc->pb);
#endif

Paul

Hamish:

> after svn up, libogsf in develbranch_6 does not build:

....

> http://trac.osgeo.org/grass/changeset/35272

Paul Kelly wrote:

Perhaps the call to url_fclose could be conditionalised on the version
of libavformat, something like (untested):

#ifdef (LIBAVFORMAT_VERSION_INT>>16) < 52
  url_fclose(&oc->pb);
#else
  url_fclose(oc->pb);
#endif

the above compiles after this change:

- #ifdef
+ #if

Hamish

On Mon, Jan 12, 2009 at 3:11 AM, Hamish <hamish_b@yahoo.com> wrote:

Hamish:

> after svn up, libogsf in develbranch_6 does not build:

....

> http://trac.osgeo.org/grass/changeset/35272

Paul Kelly wrote:

Perhaps the call to url_fclose could be conditionalised on the version
of libavformat, something like (untested):

#ifdef (LIBAVFORMAT_VERSION_INT>>16) < 52
  url_fclose(&oc->pb);
#else
  url_fclose(oc->pb);
#endif

the above compiles after this change:

- #ifdef
+ #if

Fixed in 6.4.0svn, 6.4.svn, 7.svn.

Markus