[MPlayer-dev-eng] [PATCH] regression fix: make -cdrom-device work again
Diego Biurrun
diego at biurrun.de
Tue Aug 5 01:02:12 CEST 2003
What about this patch?
Diego
Arwed von Merkatz writes:
> resending this patch since it seems to have been lost.
> It fixes a regression bug in head, the -cdrom-device parameter and
> config option aren't used for vcd:// and cdda:// anymore. With this
> patch they are recognized again, so i don't have to tell mplayer the
> device everytime i want to play a vcd (my cdrom isn't /dev/cdrom, it's
> /dev/cdroms/cdrom1).
>
> --
> Arwed v. Merkatz
> Grimoire Guru for video
> Sourcemage GNU/Linux
> http://www.sourcemage.org
> Index: libmpdemux/cdda.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
> retrieving revision 1.11
> diff -u -r1.11 cdda.c
> --- libmpdemux/cdda.c 17 May 2003 12:24:01 -0000 1.11
> +++ libmpdemux/cdda.c 25 Jul 2003 05:30:17 -0000
> @@ -12,6 +12,8 @@
>
> #include "cdd.h"
>
> +extern char *cdrom_device;
> +
> static struct cdda_params {
> int speed;
> int paranoia_mode;
> @@ -32,7 +34,7 @@
> 0,
> 0,
> 0,
> - DEFAULT_CDROM_DEVICE,
> + "",
> { 0, 0 }
> };
>
> @@ -99,6 +101,12 @@
> if(m != STREAM_READ) {
> m_struct_free(&stream_opts,opts);
> return STREAM_UNSUPORTED;
> + }
> +
> + if ((strlen(p->device) == 0) && cdrom_device){
> + p->device = cdrom_device;
> + } else {
> + p->device = DEFAULT_CDROM_DEVICE;
> }
>
> #ifdef MPLAYER_NETWORK
> Index: libmpdemux/stream_vcd.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/stream_vcd.c,v
> retrieving revision 1.2
> diff -u -r1.2 stream_vcd.c
> --- libmpdemux/stream_vcd.c 17 May 2003 12:24:01 -0000 1.2
> +++ libmpdemux/stream_vcd.c 25 Jul 2003 05:30:17 -0000
> @@ -23,12 +23,14 @@
> #include "vcd_read.h"
> #endif
>
> +extern char *cdrom_device;
> +
> static struct stream_priv_s {
> int track;
> char* device;
> } stream_priv_dflts = {
> 1,
> - DEFAULT_CDROM_DEVICE
> + ""
> };
>
> #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f)
> @@ -73,6 +75,12 @@
> if(mode != STREAM_READ) {
> m_struct_free(&stream_opts,opts);
> return STREAM_UNSUPORTED;
> + }
> +
> + if ((strlen(p->device) == 0) && cdrom_device){
> + p->device = cdrom_device;
> + } else {
> + p->device = DEFAULT_CDROM_DEVICE;
> }
>
> f=open(p->device,O_RDONLY);
More information about the MPlayer-dev-eng
mailing list