cdparanoia: expose cache size setting

This setting was added in cdparanoia 10.2.  The default value is good
for audio extraction, but lower values (previous versions of cdparanoia
used 150) are better for realtime playback.

Fixes #586331.
This commit is contained in:
Jonathan Matthew 2009-06-19 11:27:40 +10:00 committed by Tim-Philipp Müller
parent b80b350840
commit 9daee1f4a9
3 changed files with 27 additions and 1 deletions

View file

@ -480,6 +480,14 @@ AG_GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, , AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
defined if cdda headers are in a cdda/ directory) defined if cdda headers are in a cdda/ directory)
fi fi
if test "x$FOUND_CDPARANOIA" = "xyes";
then
AC_CHECK_LIB(cdda_paranoia,
paranoia_cachemodel_size,
: ,
HAVE_CDPARANOIA=no)
fi
AC_SUBST(CDPARANOIA_LIBS) AC_SUBST(CDPARANOIA_LIBS)
]) ])
dnl FIXME : add second check somehow if that is necessary dnl FIXME : add second check somehow if that is necessary

View file

@ -43,13 +43,15 @@ enum
PROP_READ_SPEED, PROP_READ_SPEED,
PROP_PARANOIA_MODE, PROP_PARANOIA_MODE,
PROP_SEARCH_OVERLAP, PROP_SEARCH_OVERLAP,
PROP_GENERIC_DEVICE PROP_GENERIC_DEVICE,
PROP_CACHE_SIZE
}; };
#define DEFAULT_READ_SPEED -1 #define DEFAULT_READ_SPEED -1
#define DEFAULT_SEARCH_OVERLAP -1 #define DEFAULT_SEARCH_OVERLAP -1
#define DEFAULT_PARANOIA_MODE PARANOIA_MODE_FRAGMENT #define DEFAULT_PARANOIA_MODE PARANOIA_MODE_FRAGMENT
#define DEFAULT_GENERIC_DEVICE NULL #define DEFAULT_GENERIC_DEVICE NULL
#define DEFAULT_CACHE_SIZE -1
GST_DEBUG_CATEGORY_STATIC (gst_cd_paranoia_src_debug); GST_DEBUG_CATEGORY_STATIC (gst_cd_paranoia_src_debug);
#define GST_CAT_DEFAULT gst_cd_paranoia_src_debug #define GST_CAT_DEFAULT gst_cd_paranoia_src_debug
@ -125,6 +127,7 @@ gst_cd_paranoia_src_init (GstCdParanoiaSrc * src, GstCdParanoiaSrcClass * klass)
src->paranoia_mode = DEFAULT_PARANOIA_MODE; src->paranoia_mode = DEFAULT_PARANOIA_MODE;
src->read_speed = DEFAULT_READ_SPEED; src->read_speed = DEFAULT_READ_SPEED;
src->generic_device = g_strdup (DEFAULT_GENERIC_DEVICE); src->generic_device = g_strdup (DEFAULT_GENERIC_DEVICE);
src->cache_size = DEFAULT_CACHE_SIZE;
} }
static void static void
@ -158,6 +161,11 @@ gst_cd_paranoia_src_class_init (GstCdParanoiaSrcClass * klass)
"Force minimum overlap search during verification to n sectors", -1, "Force minimum overlap search during verification to n sectors", -1,
75, DEFAULT_SEARCH_OVERLAP, 75, DEFAULT_SEARCH_OVERLAP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CACHE_SIZE,
g_param_spec_int ("cache-size", "Cache size",
"Set CD cache size to n sectors", -1,
G_MAXINT, DEFAULT_CACHE_SIZE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/* FIXME: we don't really want signals for this, but messages on the bus, /* FIXME: we don't really want signals for this, but messages on the bus,
* but then we can't check any longer whether anyone is interested in them */ * but then we can't check any longer whether anyone is interested in them */
@ -245,6 +253,8 @@ gst_cd_paranoia_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device)
if (src->search_overlap != -1) if (src->search_overlap != -1)
paranoia_overlapset (src->p, src->search_overlap); paranoia_overlapset (src->p, src->search_overlap);
if (src->cache_size != -1)
paranoia_cachemodel_size (src->p, src->cache_size);
src->next_sector = -1; src->next_sector = -1;
@ -442,6 +452,10 @@ gst_cd_paranoia_src_set_property (GObject * object, guint prop_id,
src->search_overlap = g_value_get_int (value); src->search_overlap = g_value_get_int (value);
break; break;
} }
case PROP_CACHE_SIZE:{
src->cache_size = g_value_get_int (value);
break;
}
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -471,6 +485,9 @@ gst_cd_paranoia_src_get_property (GObject * object, guint prop_id,
case PROP_SEARCH_OVERLAP: case PROP_SEARCH_OVERLAP:
g_value_set_int (value, src->search_overlap); g_value_set_int (value, src->search_overlap);
break; break;
case PROP_CACHE_SIZE:
g_value_set_int (value, src->cache_size);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;

View file

@ -63,6 +63,7 @@ struct _GstCdParanoiaSrc {
gint paranoia_mode; gint paranoia_mode;
gint read_speed; gint read_speed;
gint search_overlap; gint search_overlap;
gint cache_size;
gchar *generic_device; gchar *generic_device;
}; };