--- ogmrip-0.10.0/libogmrip/ogmrip-xvid.c 2006-09-14 22:28:33.000000000 +0200 +++ /home/billl/devel/ogmrip/libogmrip/ogmrip-xvid.c 2006-10-23 22:53:04.000000000 +0200 @@ -21,6 +21,7 @@ #include "ogmrip-fs.h" #include "ogmrip-xvid.h" #include "ogmrip-backend.h" +#include "ogmrip-version.h" #include "ogmjob-enums.h" #include "ogmjob-exec.h" @@ -67,9 +68,9 @@ gchar **argv; gint result; -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) gchar *cwd; -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION */ argv = ogmrip_backend_xvid_command (OGMRIP_VIDEO (spawn), NULL, NULL, NULL); if (!argv) @@ -80,23 +81,23 @@ ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) /* * Workaround against xvid pass log file */ cwd = g_get_current_dir (); g_chdir (g_get_tmp_dir ()); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION */ result = OGMJOB_SPAWN_CLASS (ogmrip_xvid_parent_class)->run (spawn); -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) /* * Return in cwd */ g_chdir (cwd); g_free (cwd); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION */ ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); --- ogmrip-0.10.0/libogmrip/ogmrip-backend.c 2006-10-09 22:09:07.000000000 +0200 +++ /home/billl/devel/ogmrip/libogmrip/ogmrip-backend.c 2006-10-23 23:22:48.000000000 +0200 @@ -19,6 +19,7 @@ #include "config.h" #include "ogmrip-backend.h" +#include "ogmrip-version.h" #include "ogmrip-lavc.h" #include "ogmrip-xvid.h" #include "ogmrip-avi.h" @@ -55,11 +56,11 @@ #define OGMRIP_X264_HIGH_OPTIONS "subq=5:b_pyramid:weight_b:frameref=2" #define OGMRIP_X264_FAST_OPTIONS "subq=4:b_pyramid:weight_b" -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) #define CROP_FRAMES 12 #else #define CROP_FRAMES 30 -#endif +#endif /* MPLAYER_CHECK_VERSION */ static const gchar *deinterlacer[] = { "pp=lb", "pp=li", "pp=ci", "pp=md", "pp=fd", "kerndeint" }; @@ -427,9 +428,9 @@ guint start, end; gint vid, aid; -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) gint srate; -#endif +#endif /* MPLAYER_CHECK_VERSION */ g_return_val_if_fail (OGMRIP_IS_AUDIO (audio), NULL); @@ -457,17 +458,17 @@ g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-ao")); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) if (header) g_ptr_array_add (argv, g_strdup_printf ("pcm:fast:waveheader:file=%s", output)); else g_ptr_array_add (argv, g_strdup_printf ("pcm:fast:nowaveheader:file=%s", output)); -#elif MPLAYER_PRE >= 7 +#elif MPLAYER_CHECK_VERSION(1,0,0,7) if (header) g_ptr_array_add (argv, g_strdup_printf ("pcm:waveheader:file=%s", output)); else g_ptr_array_add (argv, g_strdup_printf ("pcm:nowaveheader:file=%s", output)); -#else /* MPLAYER_PRE < 7 */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,7) 7 */ g_ptr_array_add (argv, g_strdup ("pcm")); if (header) g_ptr_array_add (argv, g_strdup ("-waveheader")); @@ -475,22 +476,22 @@ g_ptr_array_add (argv, g_strdup ("-nowaveheader")); g_ptr_array_add (argv, g_strdup ("-aofile")); g_ptr_array_add (argv, g_strdup (output)); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ options = g_string_new (NULL); if (ogmrip_audio_get_normalize (audio)) { -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_string_append (options, "volnorm=1"); -#elif MPLAYER_PRE >= 6 +#elif MPLAYER_CHECK_VERSION(1,0,0,6) g_string_append (options, "volnorm"); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,6) */ g_string_append (options, "list=volnorm"); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ } -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) srate = ogmrip_audio_get_sample_rate (audio); if (srate != 48000) { @@ -498,17 +499,17 @@ g_string_append_c (options, ','); g_string_append_printf (options, "lavcresample=%d", srate); } -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ if (options->len == 0) g_string_free (options, TRUE); else { -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) g_ptr_array_add (argv, g_strdup ("-af")); -#else +#else /* MPLAYER_CHECK_VERSION(1,0,0,6) */ g_ptr_array_add (argv, g_strdup ("-aop")); -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ g_ptr_array_add (argv, g_string_free (options, FALSE)); } @@ -529,12 +530,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -573,13 +574,13 @@ g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-ovc")); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("copy")); g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("rawaudio")); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("frameno")); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-oac")); g_ptr_array_add (argv, g_strdup ("copy")); @@ -608,12 +609,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -902,10 +903,10 @@ break; } -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) if (ogmrip_video_get_cartoon (video)) g_string_append (options, ":cartoon"); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ if (ogmrip_video_get_qpel (video)) g_string_append (options, ":qpel"); @@ -962,12 +963,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -1017,10 +1018,10 @@ break; } -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) if (ogmrip_video_get_turbo (video)) g_string_append (options, ":turbo"); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ if (ogmrip_video_get_qpel (video)) g_string_append (options, ":qpel"); @@ -1078,12 +1079,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -1134,10 +1135,10 @@ break; } -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) if (ogmrip_video_get_turbo (video)) g_string_append (options, ":turbo=1"); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ if (ogmrip_video_get_4mv (video)) g_string_append (options, ":4x4mv"); @@ -1186,12 +1187,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -1308,11 +1309,11 @@ g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_video_get_angle (video))); g_ptr_array_add (argv, g_strdup ("-vo")); -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) g_ptr_array_add (argv, g_strdup_printf ("yuv4mpeg:file=%s", output)); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,6) */ g_ptr_array_add (argv, g_strdup ("yuv4mpeg")); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ ogmrip_codec_get_chapters (OGMRIP_CODEC (video), &start, &end); g_ptr_array_add (argv, g_strdup ("-chapter")); @@ -1324,12 +1325,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -1379,9 +1380,9 @@ const gchar *device; gint vid; -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) gint sstep; -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_return_val_if_fail (OGMRIP_IS_VIDEO (video), NULL); @@ -1390,18 +1391,18 @@ argv = g_ptr_array_new (); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); -#else +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("lavc")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup ("/dev/null")); -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-nosound")); g_ptr_array_add (argv, g_strdup ("-nocache")); @@ -1411,15 +1412,15 @@ ogmrip_codec_get_length (OGMRIP_CODEC (video), &time_); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) sstep = (time_.hour * 3600 + time_.min * 60 + time_.sec) / (3 * CROP_FRAMES) + 1; g_ptr_array_add (argv, g_strdup ("-sstep")); g_ptr_array_add (argv, g_strdup_printf ("%d", sstep)); -#else +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%02u:%02u:%02u", time_.hour / 4, time_.min / 4 + (time_.hour % 4) * 15, time_.sec / 4 + (time_.min % 4) * 15)); -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%d", CROP_FRAMES)); @@ -1430,12 +1431,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); @@ -1601,10 +1602,10 @@ { g_ptr_array_add (argv, g_strdup ("--language")); g_ptr_array_add (argv, g_strconcat ("0:", iso639_2, NULL)); -#if MPLAYER_PRE < 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("--language")); g_ptr_array_add (argv, g_strconcat ("1:", iso639_2, NULL)); -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ } } @@ -1752,7 +1753,7 @@ input = ogmrip_codec_get_output (codec); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("-audiofile")); g_ptr_array_add (argv, g_strdup (input)); @@ -1763,7 +1764,7 @@ g_ptr_array_add (argv, g_strdup ("-rawaudio")); g_ptr_array_add (argv, g_strdup_printf ("format=0x%x", demuxer)); } -#else +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ if (demuxer == OGMRIP_AUDIO_DEMUXER_AUTO) { g_ptr_array_add (argv, g_strdup ("-audiofile")); @@ -1778,7 +1779,7 @@ g_rename (input, new_name); strcpy ((gchar *) input, new_name); } -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ #ifdef HAVE_AAC_SUPPORT /* @@ -1801,9 +1802,9 @@ GPtrArray *argv; const gchar *fourcc; -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) const gchar *label; -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); @@ -1826,14 +1827,14 @@ g_ptr_array_add (argv, g_strdup (fourcc)); } -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) label = ogmrip_container_get_label (container); if (label) { g_ptr_array_add (argv, g_strdup ("-info")); g_ptr_array_add (argv, g_strdup_printf ("name=%s", label)); } -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ return argv; } @@ -1928,10 +1929,10 @@ g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-nosound")); -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("rawaudio")); -#endif +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("copy")); @@ -1967,12 +1968,12 @@ vid = ogmdvd_title_get_nr (title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,1) */ g_ptr_array_add (argv, NULL); --- ogmrip-0.10.0/libogmrip/Makefile.am 2006-09-14 22:28:33.000000000 +0200 +++ /home/billl/devel/ogmrip/libogmrip/Makefile.am 2006-10-23 21:32:13.000000000 +0200 @@ -6,7 +6,7 @@ ogmrip-audio.c \ ogmrip-avi.c \ ogmrip-backend.c \ - ogmrip-chapters.c \ + ogmrip-chapters.c \ ogmrip-codec.c \ ogmrip-container.c \ ogmrip-dvdcpy.c \ @@ -27,7 +27,7 @@ ogmrip-acopy.h \ ogmrip-audio.h \ ogmrip-avi.h \ - ogmrip-chapters.h \ + ogmrip-chapters.h \ ogmrip-codec.h \ ogmrip-container.h \ ogmrip-dvdcpy.h \ @@ -35,6 +35,7 @@ ogmrip-mp3.h \ ogmrip-ogg.h \ ogmrip-subp.h \ + ogmrip-version.h \ ogmrip-video.h \ ogmrip-vobsub.h \ ogmrip-vorbis.h \ @@ -98,7 +99,8 @@ -version-info $(OGMRIP_LT_VERSION) EXTRA_DIST = \ - ogmrip-backend.h \ + ogmrip-backend.h \ + ogmrip-version.h.in \ ogmrip-xml.h if MAINTAINER_MODE @@ -113,9 +115,13 @@ -I$(top_srcdir)/libogmdvd \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" -ogmripincdir = $(includedir)/ogmrip -ogmripinc_DATA = ogmrip.h +ogmripincdir = \ + $(includedir)/ogmrip +ogmripinc_DATA = \ + ogmrip.h \ + ogmrip-version.h DISTCLEANFILES = \ - ogmrip.h + ogmrip.h \ + ogmrip-version.h --- ogmrip-0.10.0/libogmrip/ogmrip-version.h.in 1970-01-01 01:00:00.000000000 +0100 +++ /home/billl/devel/ogmrip/libogmrip/ogmrip-version.h.in 2006-10-23 22:31:05.000000000 +0200 @@ -0,0 +1,46 @@ +#ifndef __OGMRIP_VERSION_H__ +#define __OGMRIP_VERSION_H__ + +/* + * Compile time version of OGMRip + */ + +#define OGMRIP_MAJOR_VERSION (@OGMRIP_MAJOR_VERSION@) +#define OGMRIP_MINOR_VERSION (@OGMRIP_MINOR_VERSION@) +#define OGMRIP_MICRO_VERSION (@OGMRIP_MICRO_VERSION@) + +/* + * Compile time version of MPlayer + */ + +#define MPLAYER_MAJOR_VERSION (@MPLAYER_MAJOR_VERSION@) +#define MPLAYER_MINOR_VERSION (@MPLAYER_MINOR_VERSION@) +#define MPLAYER_PRE_VERSION (@MPLAYER_PRE_VERSION@) +#define MPLAYER_RC_VERSION (@MPLAYER_RC_VERSION@) + +/* + * Check if version if equal or greather than + * major.minor.micro + */ + +#define OGMRIP_CHECK_VERSION(major,minor,micro) \ + ((OGMRIP_MAJOR_VERSION > (major)) || \ + (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION > (minor)) || \ + (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION == (minor) && OGMRIP_MICRO_VERSION >= (micro))) + +/* + * Check if version is equal or greather than + * major.minor, major.minor-rc or major.minor-pre + * in that order + */ + +#define MPLAYER_CHECK_VERSION(major,minor,rc,pre) \ + ((MPLAYER_MAJOR_VERSION > (major)) || \ + (MPLAYER_MAJOR_VERSION == (major) && MPLAYER_MINOR_VERSION > (minor)) || \ + (MPLAYER_MAJOR_VERSION == (major) && MPLAYER_MINOR_VERSION == (minor) && \ + ((MPLAYER_RC_VERSION == 0 && MPLAYER_PRE_VERSION == 0) || \ + ((MPLAYER_RC_VERSION != 0 || MPLAYER_PRE_VERSION != 0) && ((rc) != 0 || (pre) != 0) && (MPLAYER_RC_VERSION > (rc))) || \ + ((MPLAYER_RC_VERSION != 0 || MPLAYER_PRE_VERSION != 0) && ((rc) != 0 || (pre) != 0) && MPLAYER_RC_VERSION == (rc) && MPLAYER_PRE_VERSION >= (pre))))) + +#endif /* __OGMRIP_VERSION_H__ */ + --- ogmrip-0.10.0/configure.in 2006-10-22 18:24:48.000000000 +0200 +++ /home/billl/devel/ogmrip/configure.in 2006-10-23 21:33:00.000000000 +0200 @@ -2,12 +2,30 @@ AC_PREREQ(2.53) -AC_INIT(OGMRip, 0.10.0) +m4_define([ogmrip_major_version], [0]) +m4_define([ogmrip_minor_version], [10]) +m4_define([ogmrip_micro_version], [0]) +m4_define([ogmrip_version], [ogmrip_major_version.ogmrip_minor_version.ogmrip_micro_version]) + +AC_INIT([OGMRip], [ogmrip_version]) AC_CONFIG_SRCDIR(src/ogmrip-main.c) AM_INIT_AUTOMAKE(ogmrip, AC_PACKAGE_VERSION) AC_CONFIG_HEADERS(config.h) +dnl ************************************************************** + +OGMRIP_MAJOR_VERSION=ogmrip_major_version +OGMRIP_MINOR_VERSION=ogmrip_minor_version +OGMRIP_MICRO_VERSION=ogmrip_micro_version +OGMRIP_VERSION=ogmrip_version +AC_SUBST(OGMRIP_MAJOR_VERSION) +AC_SUBST(OGMRIP_MINOR_VERSION) +AC_SUBST(OGMRIP_MICRO_VERSION) +AC_SUBST(OGMRIP_VERSION) + +dnl ************************************************************** + AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL @@ -163,22 +181,32 @@ if $MPLAYER_PROG 2> /dev/null | grep -q "MPlayer dev-\(CVS\|SVN\)"; then have_mplayer_dev=yes - AC_DEFINE_UNQUOTED(MPLAYER_MAJOR, 1, [Mplayer major version number]) - AC_DEFINE_UNQUOTED(MPLAYER_PRE, 99, [Mplayer pre version number]) + MPLAYER_MAJOR_VERSION=99 + MPLAYER_MINOR_VERSION=99 + MPLAYER_PRE_VERSION=99 + MPLAYER_RC_VERSION=99 AC_MSG_WARN(Mplayer SVN/CVS detected - USE AT YOUR OWN RISK) else have_mplayer_dev=no - MPLAYER_MAJOR=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer \([[0-1]]\).*%\1%'` - AC_DEFINE_UNQUOTED(MPLAYER_MAJOR, $MPLAYER_MAJOR, [Mplayer major version number]) + MPLAYER_MAJOR_VERSION=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer \([[0-1]]\).*%\1%'` + MPLAYER_MINOR_VERSION=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer [[0-1]]\.\([[0-9]]\).*%\1%'` + MPLAYER_PRE_VERSION=0 + MPLAYER_RC_VERSION=0 if $MPLAYER_PROG 2> /dev/null | grep -q "^MPlayer [[0-1]]\.[[0-9]]\+pre[[0-9]]\+.*"; then - MPLAYER_PRE=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer [[0-1]]\.[[0-9]]\+pre\([[0-9]]\+\).*%\1%'` - AC_DEFINE_UNQUOTED(MPLAYER_PRE, $MPLAYER_PRE, [Mplayer pre version number]) - else - AC_DEFINE_UNQUOTED(MPLAYER_PRE, 0, [Mplayer pre version number]) + MPLAYER_PRE_VERSION=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer [[0-1]]\.[[0-9]]\+pre\([[0-9]]\+\).*%\1%'` + fi + + if $MPLAYER_PROG 2> /dev/null | grep -q "^MPlayer [[0-1]]\.[[0-9]]\+rc[[0-9]]\+.*"; then + MPLAYER_RC_VERSION=`$MPLAYER_PROG 2> /dev/null | grep "^MPlayer" | $SED_PROG -e 's%^MPlayer [[0-1]]\.[[0-9]]\+rc\([[0-9]]\+\).*%\1%'` fi fi +AC_SUBST(MPLAYER_MAJOR_VERSION) +AC_SUBST(MPLAYER_MINOR_VERSION) +AC_SUBST(MPLAYER_PRE_VERSION) +AC_SUBST(MPLAYER_RC_VERSION) + dnl ************************************************************** AC_PATH_PROG(MENCODER_PROG, mencoder) @@ -450,6 +478,7 @@ #include #include #include +#include #include #include #include @@ -565,6 +594,7 @@ libogmdvd-gtk/Makefile libogmjob/Makefile libogmrip/Makefile +libogmrip/ogmrip-version.h libbacon/Makefile data/Makefile data/ogmdvd.pc --- ogmrip-0.10.0/src/ogmrip-crop.c 2006-10-22 15:48:49.000000000 +0200 +++ /home/billl/devel/ogmrip/src/ogmrip-crop.c 2006-10-23 23:30:12.000000000 +0200 @@ -19,6 +19,7 @@ #include "config.h" #include "ogmdvd.h" +#include "ogmrip.h" #include "ogmrip-crop.h" #include "ogmrip-helper.h" @@ -104,25 +105,25 @@ g_ptr_array_add (argv, g_strdup ("-vo")); -#if MPLAYER_PRE >= 6 +#if MPLAYER_CHECK_VERSION(1,0,0,6) g_ptr_array_add (argv, g_strdup_printf ("jpeg:outdir=%s", ogmrip_fs_get_tmp_dir ())); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,6) */ g_ptr_array_add (argv, g_strdup ("jpeg")); g_ptr_array_add (argv, g_strdup ("-jpeg")); g_ptr_array_add (argv, g_strdup_printf ("outdir=%s", ogmrip_fs_get_tmp_dir ())); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,6) */ -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) g_ptr_array_add (argv, g_strdup ("-vc")); g_ptr_array_add (argv, g_strdup ("ffmpeg12")); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("1")); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("3")); g_ptr_array_add (argv, g_strdup ("-sstep")); g_ptr_array_add (argv, g_strdup ("1")); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ chap = ogmrip_crop_get_chapter (data->title, &frame); g_ptr_array_add (argv, g_strdup ("-chapter")); @@ -138,12 +139,12 @@ vid = ogmdvd_title_get_nr (data->title); -#if MPLAYER_MAJOR > 0 +#if MPLAYER_CHECK_VERSION(1,0,0,1) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); -#else /* MPLAYER_MAJOR */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); -#endif /* MPLAYER_MAJOR */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ g_ptr_array_add (argv, NULL); @@ -182,9 +183,9 @@ { gchar *filename; -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000001.jpg", NULL); -#else /* MPLAYER_PRE */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) */ filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000001.jpg", NULL); g_unlink (filename); g_free (filename); @@ -194,7 +195,7 @@ g_free (filename); filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000002.jpg", NULL); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { --- ogmrip-0.10.0/src/ogmrip-main.c 2006-10-09 22:46:28.000000000 +0200 +++ /home/billl/devel/ogmrip/src/ogmrip-main.c 2006-10-23 23:36:31.000000000 +0200 @@ -27,11 +27,11 @@ #include "ogmrip-chapter-list.h" #include "ogmrip-chooser-list.h" -#include -#include +#include "ogmdvd.h" +#include "ogmdvd-gtk.h" -#include -#include +#include "ogmjob.h" +#include "ogmrip.h" #ifdef HAVE_ENCHANT_SUPPORT #include "ogmrip-spell.h" @@ -206,16 +206,16 @@ static gchar * ogmrip_main_mklog (void) { -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) GConfClient *gconf; GType type; gint codec; -#endif +#endif /* !MPLAYER_CHECK_VERSION(1,0,0,8) */ gchar *filename; -#if MPLAYER_PRE >= 8 +#if MPLAYER_CHECK_VERSION(1,0,0,8) filename = ogmrip_fs_mktemp ("log.XXXXXX", NULL); -#else /* MPLAYER_PRE < 8 */ +#else /* MPLAYER_CHECK_VERSION(1,0,0,8) < 8 */ /* * Workaround against xvid pass log file * Should disappear someday @@ -230,7 +230,7 @@ filename = g_build_filename (g_get_tmp_dir (), "xvid-twopass.stats", NULL); else filename = ogmrip_fs_mktemp ("log.XXXXXX", NULL); -#endif /* MPLAYER_PRE */ +#endif /* MPLAYER_CHECK_VERSION(1,0,0,8) */ return filename; } @@ -935,17 +935,17 @@ ogmrip_main_merge (OGMRipData *data, OGMRipContainer *container, GError **error) { gint result; -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) gchar *cwd; -#endif /* MPLAYER_PRE */ +#endif /* !MPLAYER_CHECK_VERSION(1,0,0,8) */ ogmrip_progress_set_spawn (data->progress_dialog, OGMJOB_SPAWN (container), _("Merging audio and video streams")); -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) cwd = g_get_current_dir (); g_chdir (ogmrip_fs_get_tmp_dir ()); -#endif /* MPLAYER_PRE */ +#endif /* !MPLAYER_CHECK_VERSION(1,0,0,8) */ result = ogmjob_spawn_run (OGMJOB_SPAWN (container), error); @@ -954,10 +954,10 @@ _("Unknown error while merging"), _("Please, check http://ogmrip.sf.net to see if this is a known issue")); -#if MPLAYER_PRE < 8 +#if !MPLAYER_CHECK_VERSION(1,0,0,8) g_chdir (cwd); g_free (cwd); -#endif /* MPLAYER_PRE */ +#endif /* !MPLAYER_CHECK_VERSION(1,0,0,8) */ return result; }