mirror of https://github.com/mpv-player/mpv
more cosmetics
remove overlooked trailing whitespace cut overly long lines (>79 characters) file passes checktree.sh -all -norcsid <file> now git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22290 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
40b89d03c8
commit
19f117a277
|
@ -74,7 +74,8 @@ static void disk_flush(int time) {
|
|||
}
|
||||
|
||||
static int disk_free(void) { // vqf plugin sends more than it should
|
||||
return (XMMS_PACKETSIZE-xmms_audiopos<XMMS_PACKETSIZE/4 ? 0:XMMS_PACKETSIZE-xmms_audiopos-XMMS_PACKETSIZE/4);
|
||||
return (XMMS_PACKETSIZE-xmms_audiopos<XMMS_PACKETSIZE/4 ?
|
||||
0:XMMS_PACKETSIZE-xmms_audiopos-XMMS_PACKETSIZE/4);
|
||||
}
|
||||
|
||||
static int disk_playing(void) {
|
||||
|
@ -165,12 +166,14 @@ static int no_plugins=0;
|
|||
|
||||
/* Dummy functions */
|
||||
static InputVisType input_get_vis_type(){return 0;}
|
||||
static void input_add_vis_pcm(int time, AFormat fmt, int nch, int length, void *ptr){}
|
||||
static void input_add_vis_pcm(int time, AFormat fmt, int nch, int length,
|
||||
void *ptr){}
|
||||
static void input_set_info_text(char * text){}
|
||||
char *xmms_get_gentitle_format(){ return ""; }
|
||||
/* Dummy functions END*/
|
||||
|
||||
static void input_set_info(char* title,int length, int rate, int freq, int nch){
|
||||
static void input_set_info(char* title,int length, int rate, int freq, int nch)
|
||||
{
|
||||
xmms_length=length;
|
||||
}
|
||||
|
||||
|
@ -191,7 +194,8 @@ static void init_plugins_from_dir(const char *plugin_dir){
|
|||
gpi=dlsym(handle, "get_iplugin_info");
|
||||
if(gpi){
|
||||
InputPlugin *p=gpi();
|
||||
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_FoundPlugin,ent->d_name,p->description);
|
||||
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_FoundPlugin,
|
||||
ent->d_name,p->description);
|
||||
p->handle = handle;
|
||||
p->filename = strdup(filename);
|
||||
p->get_vis_type = input_get_vis_type;
|
||||
|
@ -225,7 +229,8 @@ static void init_plugins(){
|
|||
static void cleanup_plugins(){
|
||||
while(no_plugins>0){
|
||||
--no_plugins;
|
||||
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_ClosingPlugin,input_plugins[no_plugins]->filename);
|
||||
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_ClosingPlugin,
|
||||
input_plugins[no_plugins]->filename);
|
||||
if(input_plugins[no_plugins]->cleanup)
|
||||
input_plugins[no_plugins]->cleanup();
|
||||
dlclose(input_plugins[no_plugins]->handle);
|
||||
|
@ -274,10 +279,12 @@ static int demux_xmms_open(demuxer_t* demuxer) {
|
|||
ip->output = &xmms_output_plugin;
|
||||
xmms_playing=1;
|
||||
ip->play_file(demuxer->stream->url);
|
||||
if (ip->get_song_info) ip->get_song_info(demuxer->stream->url,&xmms_title,&xmms_length);
|
||||
if (ip->get_song_info)
|
||||
ip->get_song_info(demuxer->stream->url,&xmms_title,&xmms_length);
|
||||
if (xmms_length<=0) demuxer->seekable=0;
|
||||
|
||||
mp_msg(MSGT_DEMUX,MSGL_INFO,"Waiting for the XMMS plugin to start playback of '%s'...\n",demuxer->stream->url);
|
||||
mp_msg(MSGT_DEMUX,MSGL_INFO,"Waiting for the XMMS plugin to start "
|
||||
"playback of '%s'...\n",demuxer->stream->url);
|
||||
while (xmms_channels==0) {
|
||||
usleep(10000);
|
||||
if(ip->get_time()<0) return 0;
|
||||
|
@ -296,7 +303,8 @@ static int demux_xmms_open(demuxer_t* demuxer) {
|
|||
w->wBitsPerSample = sh_audio->samplesize*8;
|
||||
w->nChannels = sh_audio->channels = xmms_channels;
|
||||
w->nSamplesPerSec = sh_audio->samplerate = xmms_samplerate;
|
||||
xmms_byterate = w->nAvgBytesPerSec = xmms_samplerate*sh_audio->channels*sh_audio->samplesize;
|
||||
xmms_byterate = w->nAvgBytesPerSec =
|
||||
xmms_samplerate*sh_audio->channels*sh_audio->samplesize;
|
||||
w->nBlockAlign = sh_audio->samplesize*sh_audio->channels;
|
||||
w->cbSize = 0;
|
||||
|
||||
|
@ -323,7 +331,8 @@ static int demux_xmms_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) {
|
|||
ds->pos = priv->spos;
|
||||
|
||||
memcpy(dp->buffer,xmms_audiobuffer,XMMS_PACKETSIZE/2);
|
||||
memcpy(xmms_audiobuffer,&xmms_audiobuffer[XMMS_PACKETSIZE/2],xmms_audiopos-XMMS_PACKETSIZE/2);
|
||||
memcpy(xmms_audiobuffer,&xmms_audiobuffer[XMMS_PACKETSIZE/2],
|
||||
xmms_audiopos-XMMS_PACKETSIZE/2);
|
||||
xmms_audiopos-=XMMS_PACKETSIZE/2;
|
||||
pthread_mutex_unlock(&xmms_mutex);
|
||||
|
||||
|
@ -332,7 +341,8 @@ static int demux_xmms_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void demux_xmms_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags){
|
||||
static void demux_xmms_seek(demuxer_t *demuxer,float rel_seek_secs,
|
||||
float audio_delay,int flags){
|
||||
stream_t* s = demuxer->stream;
|
||||
sh_audio_t* sh_audio = demuxer->audio->sh;
|
||||
xmms_priv_t *priv=demuxer->priv;
|
||||
|
@ -379,7 +389,8 @@ static int demux_xmms_control(demuxer_t *demuxer,int cmd, void *arg){
|
|||
case DEMUXER_CTRL_GET_PERCENT_POS:
|
||||
if (xmms_length<=0)
|
||||
return DEMUXER_CTRL_DONTKNOW;
|
||||
*((int *)arg)=(int)( priv->spos / (float)(sh_audio->wf->nAvgBytesPerSec) / xmms_length );
|
||||
*((int *)arg)=(int)( priv->spos /
|
||||
(float)(sh_audio->wf->nAvgBytesPerSec) / xmms_length );
|
||||
return DEMUXER_CTRL_OK;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue