changeset 34371:a4dd7151526b

Do not call paranoia_overlapset with 0, it actually causes cdparanoia to just hang. Instead use it to set/unset PARANOIA_MODE_OVERLAP.
author reimar
date Fri, 23 Dec 2011 16:44:23 +0000
parents a958ea863ee1
children 622b7e95695a
files stream/stream_cdda.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_cdda.c	Fri Dec 23 16:27:15 2011 +0000
+++ b/stream/stream_cdda.c	Fri Dec 23 16:44:23 2011 +0000
@@ -88,7 +88,7 @@
   { "paranoia", ST_OFF(paranoia_mode), CONF_TYPE_INT,M_OPT_RANGE, 0, 2, NULL },
   { "generic-dev", ST_OFF(generic_dev), CONF_TYPE_STRING, 0, 0, 0, NULL },
   { "sector-size", ST_OFF(sector_size), CONF_TYPE_INT, M_OPT_RANGE,1,100, NULL },
-  { "overlap", ST_OFF(search_overlap), CONF_TYPE_INT, M_OPT_RANGE,0,75, NULL },
+  { "overlap", ST_OFF(search_overlap), CONF_TYPE_INT, M_OPT_RANGE,-1,75, NULL },
   { "toc-bias", ST_OFF(toc_bias), CONF_TYPE_INT, 0, 0, 0, NULL },
   { "toc-offset", ST_OFF(toc_offset), CONF_TYPE_INT, 0, 0, 0, NULL },
   { "noskip", ST_OFF(no_skip), CONF_TYPE_FLAG, 0 , 0, 1, NULL },
@@ -418,18 +418,22 @@
 
   if(p->no_skip)
     mode |= PARANOIA_MODE_NEVERSKIP;
+  if(p->search_overlap > 0)
+    mode |= PARANOIA_MODE_OVERLAP;
+  else if(p->search_overlap == 0)
+    mode &= ~PARANOIA_MODE_OVERLAP;
 #ifndef CONFIG_LIBCDIO
   // HACK against libcdparanoia's stupid caching model that
   // queues up a huge number of requests leading to stuttering
   paranoia_cachemodel_size(priv->cdp, 24);
   paranoia_modeset(cdd, mode);
 
-  if(p->search_overlap >= 0)
+  if(p->search_overlap > 0)
     paranoia_overlapset(cdd,p->search_overlap);
 #else
   paranoia_modeset(priv->cdp, mode);
 
-  if(p->search_overlap >= 0)
+  if(p->search_overlap > 0)
     paranoia_overlapset(priv->cdp,p->search_overlap);
 #endif