Dear all

Here is a little patch that add an option "cache_size" to the cdio_paranoia plugin. This option set the libcdio_paranoia cache size (in sector), which is by default very high (1200 sectors == 16 seconds). On my setup (raspberry pi + usb dvd drive) this default value cause sound to drop every 16 seconds. With a small value of 75 sectors, it works much better.
Patch is based on mpd 0.18.21.

Thank you

Regards

Vincent
diff -Naubr mpd-0.18.21/src/input/CdioParanoiaInputPlugin.cxx mpd-0.18.21.new/src/input/CdioParanoiaInputPlugin.cxx
--- mpd-0.18.21/src/input/CdioParanoiaInputPlugin.cxx	2014-11-02 11:39:22.000000000 +0100
+++ mpd-0.18.21.new/src/input/CdioParanoiaInputPlugin.cxx	2014-12-28 16:12:54.302267688 +0100
@@ -85,6 +85,7 @@
 static constexpr Domain cdio_domain("cdio");
 
 static bool default_reverse_endian;
+static int cache_size = -1; 
 
 static bool
 input_cdio_init(const config_param &param, Error &error)
@@ -103,6 +104,18 @@
 		}
 	}
 
+	value = param.GetBlockValue("cache_size");
+        if (value != nullptr) {
+                int tmp = atoi(value);
+                if (tmp < 0 || tmp == INT_MAX) {
+			error.Format(config_domain, 0,
+                                     "Unrecognized 'cache_size' setting: %s",
+                                     value);
+                        return false;
+		}
+                cache_size = tmp;
+	}
+
 	return true;
 }
 
@@ -260,6 +273,8 @@
 	/* Set reading mode for full paranoia, but allow skipping sectors. */
 	paranoia_modeset(i->para, PARANOIA_MODE_FULL^PARANOIA_MODE_NEVERSKIP);
 
+	cdio_paranoia_cachemodel_size(i->para, cache_size);
+
 	/* seek to beginning of the track */
 	cdio_paranoia_seek(i->para, i->lsn_from, SEEK_SET);
 
_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to