[Mplayer-cvslog] CVS: main/libmpdemux cdda.c,1.2,1.3 demux_audio.c,1.10,1.11 demux_rawaudio.c,1.1,1.2 demuxer.c,1.118,1.119 network.c,1.61,1.62 test.c,1.8,1.9 opt-reg.c,1.2,NONE
Arpi of Ize
arpi at mplayerhq.hu
Wed Oct 23 19:21:33 CEST 2002
- Previous message: [Mplayer-cvslog] CVS: main/libvo video_out.c,1.61,1.62 vo_dxr2.c,1.9,1.10
- Next message: [Mplayer-cvslog] CVS: main Makefile,1.223,1.224 cfg-common.h,1.64,1.65 cfg-mplayer.h,1.175,1.176 mencoder.c,1.177,1.178 mplayer.c,1.600,1.601 me-opt-reg.c,1.1,NONE mp-opt-reg.c,1.4,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv8323/libmpdemux
Modified Files:
cdda.c demux_audio.c demux_rawaudio.c demuxer.c network.c
test.c
Removed Files:
opt-reg.c
Log Message:
cleanup config option handling in libmpdemux.
removed overcompilacted m_config_register_options() mess - export the
subconfig structs instead
Index: cdda.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cdda.c 10 Jul 2002 08:49:42 -0000 1.2
+++ cdda.c 23 Oct 2002 17:21:00 -0000 1.3
@@ -19,7 +19,7 @@
static int toc_offset = 0;
static int no_skip = 0;
-static config_t cdda_opts[] = {
+config_t cdda_opts[] = {
{ "speed", &speed, CONF_TYPE_INT, CONF_RANGE,1,100, NULL },
{ "paranoia", ¶noia_mode, CONF_TYPE_INT,CONF_RANGE, 0, 2, NULL },
{ "generic-dev", &generic_dev, CONF_TYPE_STRING, 0, 0, 0, NULL },
@@ -31,15 +31,6 @@
{ "skip", &no_skip, CONF_TYPE_FLAG, 0 , 1, 0, NULL },
{NULL, NULL, 0, 0, 0, 0, NULL}
};
-
-static config_t cdda_conf[] = {
- { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
- { NULL,NULL, 0, 0, 0, 0, NULL}
-};
-
-void cdda_register_options(m_config_t* cfg) {
- m_config_register_options(cfg,cdda_conf);
-}
stream_t* open_cdda(char* dev,char* track) {
stream_t* st;
Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- demux_audio.c 22 Oct 2002 16:02:21 -0000 1.10
+++ demux_audio.c 23 Oct 2002 17:21:00 -0000 1.11
@@ -29,7 +29,7 @@
extern void free_sh_audio(sh_audio_t* sh);
extern void resync_audio_stream(sh_audio_t *sh_audio);
-static int hr_mp3_seek = 0;
+int hr_mp3_seek = 0;
int demux_audio_open(demuxer_t* demuxer) {
stream_t *s;
@@ -337,16 +337,3 @@
free(priv);
}
-/****************** Options stuff ******************/
-
-#include "../cfgparser.h"
-
-static config_t demux_audio_opts[] = {
- { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL },
- { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {NULL, NULL, 0, 0, 0, 0, NULL}
-};
-
-void demux_audio_register_options(m_config_t* cfg) {
- m_config_register_options(cfg,demux_audio_opts);
-}
Index: demux_rawaudio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rawaudio.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- demux_rawaudio.c 11 Jun 2002 14:29:51 -0000 1.1
+++ demux_rawaudio.c 23 Oct 2002 17:21:00 -0000 1.2
@@ -17,7 +17,7 @@
static int samplesize = 2;
static int format = 0x1; // Raw PCM
-static config_t demux_rawaudio_opts[] = {
+config_t demux_rawaudio_opts[] = {
{ "on", &use_rawaudio, CONF_TYPE_FLAG, 0,0, 1, NULL },
{ "channels", &channels, CONF_TYPE_INT,CONF_RANGE,1,8, NULL },
{ "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL },
@@ -26,14 +26,6 @@
{NULL, NULL, 0, 0, 0, 0, NULL}
};
-static config_t demux_rawaudio_conf[] = {
- { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
- { NULL,NULL, 0, 0, 0, 0, NULL}
-};
-
-void demux_rwaudio_register_options(m_config_t* cfg) {
- m_config_register_options(cfg,demux_rawaudio_conf);
-}
extern void resync_audio_stream(sh_audio_t *sh_audio);
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- demuxer.c 16 Oct 2002 16:51:03 -0000 1.118
+++ demuxer.c 23 Oct 2002 17:21:00 -0000 1.119
@@ -1037,9 +1037,10 @@
}
char* audio_stream = NULL;
-static char* sub_stream = NULL;
-static int demuxer_type = 0, audio_demuxer_type = 0, sub_demuxer_type = 0;
-extern m_config_t* mconfig;
+char* sub_stream = NULL;
+int demuxer_type = 0, audio_demuxer_type = 0, sub_demuxer_type = 0;
+
+extern int hr_mp3_seek;
demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id){
stream_t *as = NULL,*ss = NULL;
@@ -1069,7 +1070,7 @@
if(!ad)
mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_OpeningAudioDemuxerFailed,audio_stream);
else if(ad->audio->sh && ((sh_audio_t*)ad->audio->sh)->format == 0x55) // MP3
- m_config_set_flag(mconfig,"hr-mp3-seek",1); // Enable high res seeking
+ hr_mp3_seek=1; // Enable high res seeking
}
if(ss) {
sd = demux_open_stream(ss,sub_demuxer_type ? sub_demuxer_type : sfmt,-2,-2,dvdsub_id);
@@ -1243,20 +1244,5 @@
}
return NULL;
-}
-
-/******************* Options stuff **********************/
-
-static config_t demuxer_opts[] = {
- { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL },
- { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL },
- { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
- { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
- { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
- { NULL, NULL, 0, 0, 0, 0, NULL}
-};
-
-void demuxer_register_options(m_config_t* cfg) {
- m_config_register_options(cfg,demuxer_opts);
}
Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- network.c 23 Oct 2002 14:46:20 -0000 1.61
+++ network.c 23 Oct 2002 17:21:00 -0000 1.62
@@ -31,14 +31,14 @@
#include "../version.h"
extern int verbose;
-extern m_config_t *mconfig;
+extern int stream_cache_size;
extern int mp_input_check_interrupt(int time);
/* Variables for the command line option -user, -passwd & -bandwidth */
-char *network_username;
-char *network_password;
-int network_bandwidth;
+char *network_username=NULL;
+char *network_password=NULL;
+int network_bandwidth=0;
static struct {
@@ -381,34 +381,24 @@
} else {
mp_msg(MSGT_NETWORK,MSGL_INFO,"Authentication required\n");
}
- ret = m_config_is_option_set(mconfig,"user");
- if( ret==1 ) {
- char *username;
- username = *((char**)m_config_get_option_ptr(mconfig, "user"));
- if( username==NULL ) return -1;
- url->username = (char*)malloc(strlen(username)+1);
+ if( network_username ) {
+ url->username = strdup(network_username);
if( url->username==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return -1;
}
- strcpy(url->username, username);
} else {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to read the username\n");
mp_msg(MSGT_NETWORK,MSGL_ERR,"Please use the option -user and -passwd to provide your username/password for a list of URLs,\n");
mp_msg(MSGT_NETWORK,MSGL_ERR,"or form an URL like: http://username:password@hostname/file\n");
return -1;
}
- ret = m_config_is_option_set(mconfig,"passwd");
- if( ret==1 ) {
- char *password;
- password = *((char**)m_config_get_option_ptr(mconfig, "passwd"));
- if( password==NULL ) return -1;
- url->password = (char*)malloc(strlen(password)+1);
+ if( network_password ) {
+ url->password = strdup(network_password);
if( url->password==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return -1;
}
- strcpy(url->password, password);
} else {
mp_msg(MSGT_NETWORK,MSGL_INFO,"No password provided, trying blank password\n");
}
@@ -830,18 +820,7 @@
ret = -1;
// Get the bandwidth available
- ret = m_config_is_option_set(mconfig,"bandwidth");
- if(ret < 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to know if the bandwidth limit was set\n");
- } else {
- val = m_config_get_int( mconfig, "bandwidth", NULL);
- if( val<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to retrieve the bandwidth option value\n");
- stream->streaming_ctrl->bandwidth = 0; // Don't limit bandwidth
- } else {
- stream->streaming_ctrl->bandwidth = val;
- }
- }
+ stream->streaming_ctrl->bandwidth = network_bandwidth;
#ifndef STREAMING_LIVE_DOT_COM
// For RTP streams, we usually don't know the stream type until we open it.
@@ -905,31 +884,14 @@
streaming_ctrl_free( stream->streaming_ctrl );
stream->streaming_ctrl = NULL;
} else if( stream->streaming_ctrl->buffering ) {
- int cache_size = 0;
- int cache_opt, val;
- cache_opt = m_config_is_option_set(mconfig,"cache");
- if(cache_opt < 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to know if cache size option was set\n");
- } else if(!cache_opt) {
+ int cache_size = stream_cache_size;
+ if(!stream_cache_size) {
// cache option not set, will use our computed value.
// buffer in KBytes, *5 because the prefill is 20% of the buffer.
- val = (stream->streaming_ctrl->prebuffer_size/1024)*5;
- if( val<16 ) val = 16; // 16KBytes min buffer
- if( m_config_set_int( mconfig, "cache", val )<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to set the cache size option\n");
- } else {
- cache_size = val;
- }
- } else {
- // cache option set, will use the given one.
- val = m_config_get_int( mconfig, "cache", NULL );
- if( val<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Unable to retrieve the cache option value\n");
- } else {
- cache_size = val;
- }
+ stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5;
+ if( stream_cache_size<16 ) stream_cache_size = 16; // 16KBytes min buffer
}
- mp_msg(MSGT_NETWORK,MSGL_INFO,"Cache size set to %d KBytes\n", cache_size );
+ mp_msg(MSGT_NETWORK,MSGL_INFO,"Cache size set to %d KBytes\n", stream_cache_size);
}
return ret;
Index: test.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/test.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- test.c 23 Oct 2002 14:46:20 -0000 1.8
+++ test.c 23 Oct 2002 17:21:00 -0000 1.9
@@ -20,7 +20,7 @@
}
int mp_input_check_interrupt(int time){
- if(time) usec_sleep(time);
+ if(time) usleep(time);
return 0;
}
--- opt-reg.c DELETED ---
- Previous message: [Mplayer-cvslog] CVS: main/libvo video_out.c,1.61,1.62 vo_dxr2.c,1.9,1.10
- Next message: [Mplayer-cvslog] CVS: main Makefile,1.223,1.224 cfg-common.h,1.64,1.65 cfg-mplayer.h,1.175,1.176 mencoder.c,1.177,1.178 mplayer.c,1.600,1.601 me-opt-reg.c,1.1,NONE mp-opt-reg.c,1.4,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list