MPlayer-cvslog
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
December 2002
- 61 participants
- 492 discussions
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv21770
Modified Files:
mplayer.c
Log Message:
disabling seek (look the patch)
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.615
retrieving revision 1.616
diff -u -r1.615 -r1.616
--- mplayer.c 28 Nov 2002 19:01:24 -0000 1.615
+++ mplayer.c 28 Nov 2002 19:13:14 -0000 1.616
@@ -1954,6 +1954,7 @@
switch(cmd->id) {
case MP_CMD_SEEK : {
int v,abs;
+ if ( stream->type == STREAMTYPE_STREAM ) break;
v = cmd->args[0].v.i;
abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
if(abs==2) { /* Absolute seek to a specific timestamp in seconds */
2
1
CVS: main/libmpdemux demux_xmms.c,NONE,1.1 demux_xmms_plugin.h,NONE,1.1 Makefile,1.42,1.43 demuxer.c,1.125,1.126 demuxer.h,1.51,1.52 open.c,1.63,1.64
by Arpi of Ize 17 Jan '03
by Arpi of Ize 17 Jan '03
17 Jan '03
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv16813/libmpdemux
Modified Files:
Makefile demuxer.c demuxer.h open.c
Added Files:
demux_xmms.c demux_xmms_plugin.h
Log Message:
XMMS Input plugin support
based on patches by Balatoni Denes <pnis(a)coder.hu>
changes by me: glib dependency removed, files merged, code simplified, some bugfixes
--- NEW FILE ---
// This is not reentrant (because of global variables shared with demux_xmms_output.c)
// and the plugins are not reentrant either perhaps
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <dlfcn.h>
#include <dirent.h>
#include <inttypes.h>
#include "../cfgparser.h"
#include "../libao2/afmt.h"
#include "stream.h"
#include "demuxer.h"
#include "stheader.h"
#include <dirent.h>
#include <string.h>
#include <sys/stat.h>
//#include <glib.h>
#define XMMS_PACKETSIZE 65536 // some plugins won't play if this is too small
#include "demux_xmms_plugin.h"
//#include "demux_xmms_pluginenum.h"
//#include "demux_xmms_input.h"
//extern OutputPlugin xmms_output_plugin;
static pthread_mutex_t xmms_mutex;
static int format = 0x1; // Raw PCM
static char xmms_audiobuffer[XMMS_PACKETSIZE];
static uint32_t xmms_channels;
static uint32_t xmms_samplerate;
static uint32_t xmms_afmt;
static int xmms_length;
static char *xmms_title=NULL;
static uint32_t xmms_audiopos=0;
static uint64_t written = 0;
static void disk_close(void) {}
static void disk_flush(int time) {}
static void disk_pause(short p) {}
static void disk_init(void) {}
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);
}
static int disk_playing(void) {
return 0; //??
}
static int disk_get_output_time(void) {
return 10;
}
static int disk_open(AFormat fmt, int rate, int nch) {
switch (fmt) {
case FMT_U8:
xmms_afmt=AFMT_U8;
break;
case FMT_S8:
xmms_afmt=AFMT_S8;
break;
case FMT_U16_LE:
xmms_afmt=AFMT_U16_LE;
break;
case FMT_U16_NE:
#if WORDS_BIGENDIAN
xmms_afmt=AFMT_U16_BE;
#else
xmms_afmt=AFMT_U16_LE;
#endif
break;
case FMT_U16_BE:
xmms_afmt=AFMT_U16_BE;
break;
case FMT_S16_NE:
xmms_afmt=AFMT_S16_NE;
break;
case FMT_S16_LE:
xmms_afmt=AFMT_S16_LE;
break;
case FMT_S16_BE:
xmms_afmt=AFMT_S16_BE;
break;
}
xmms_samplerate=rate;
xmms_channels=nch;
return 1;
}
static void disk_write(void *ptr, int length) {
pthread_mutex_lock(&xmms_mutex);
written += length;
memcpy(&xmms_audiobuffer[xmms_audiopos],ptr,length);
xmms_audiopos+=length;
pthread_mutex_unlock(&xmms_mutex);
}
static OutputPlugin xmms_output_plugin =
{
NULL,
NULL,
"Mplayer output interface Plugin ", /* Description */
disk_init,
NULL, /* about */
NULL, /* configure */
NULL, /* get_volume */
NULL, /* set_volume */
disk_open,
disk_write,
disk_close,
disk_flush,
disk_pause,
disk_free,
disk_playing,
disk_get_output_time,
disk_get_output_time
};
typedef struct {
uint32_t spos;
InputPlugin* ip;
} xmms_priv_t;
static InputPlugin* input_plugins[100];
static int no_plugins=0;
/* Dummy functions */
static int input_get_vis_type(){return 0;}
//static void input_add_vis(int time, unsigned char *s, InputVisType type){}
static void input_add_vis_pcm(int time, AFormat fmt, int nch, int length, void *ptr){}
//static void input_update_vis(gint time){}
//static gchar *input_get_info_text(void){return NULL;}
static void input_set_info_text(char * text){}
static void input_set_info(char* ha,int a, int b, int c, int d){};
/* Dummy functions END*/
static void init_plugins(){
DIR *dir;
struct dirent *ent;
no_plugins=0;
dir = opendir(XMMS_INPUT_PLUGIN_DIR);
if (!dir) return;
while ((ent = readdir(dir)) != NULL){
char filename[strlen(XMMS_INPUT_PLUGIN_DIR)+strlen(ent->d_name)+4];
void* handle;
sprintf(filename,XMMS_INPUT_PLUGIN_DIR "/%s",ent->d_name);
handle=dlopen(filename, RTLD_NOW);
if(handle){
void *(*gpi) (void);
gpi=dlsym(handle, "get_iplugin_info");
if(gpi){
InputPlugin *p=gpi();
printf("XMMS: found plugin: %s (%s)\n",ent->d_name,p->description);
p->handle = handle;
p->filename = strdup(filename);
p->get_vis_type = input_get_vis_type;
p->add_vis_pcm = input_add_vis_pcm;
p->set_info = input_set_info;
p->set_info_text = input_set_info_text;
if(p->init) p->init();
input_plugins[no_plugins++]=p;
} else
dlclose(handle);
}
}
closedir(dir);
}
static void cleanup_plugins(){
while(no_plugins>0){
--no_plugins;
printf("XMMS: Closing plugin %s\n",input_plugins[no_plugins]->filename);
if(input_plugins[no_plugins]->cleanup)
input_plugins[no_plugins]->cleanup();
dlclose(input_plugins[no_plugins]->handle);
}
}
extern void resync_audio_stream(sh_audio_t *sh_audio);
int demux_xmms_open(demuxer_t* demuxer) {
InputPlugin* ip = NULL;
sh_audio_t* sh_audio;
WAVEFORMATEX* w;
xmms_priv_t *priv;
int i;
init_plugins();
for(i=0;i<no_plugins;i++){
if (input_plugins[i]->is_our_file(demuxer->stream->url)){
ip=input_plugins[i]; break;
}
}
if(!ip) return 0; // no plugin to handle this...
pthread_mutex_init(&xmms_mutex,NULL);
priv=(xmms_priv_t *)malloc(sizeof(xmms_priv_t));
memset(priv,0,sizeof(xmms_priv_t));
priv->ip=ip;
memset(xmms_audiobuffer,0,XMMS_PACKETSIZE);
xmms_channels=0;
sh_audio = new_sh_audio(demuxer,0);
sh_audio->wf = w = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEX));
w->wFormatTag = sh_audio->format = format;
demuxer->movi_start = 0;
demuxer->movi_end = 100;
demuxer->audio->id = 0;
demuxer->audio->sh = sh_audio;
demuxer->priv=priv;
sh_audio->ds = demuxer->audio;
xmms_output_plugin.init();
ip->get_song_info(demuxer->stream->url,&xmms_title,&xmms_length);
if (xmms_length<=0) demuxer->seekable=0;
// printf("XMMS song title='%s' length=%d\n",xmms_title,xmms_length);
// input_play(demuxer->stream->url);
ip->output = &xmms_output_plugin;
ip->play_file(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;
}
sh_audio->sample_format= xmms_afmt;
switch (xmms_afmt) {
case AFMT_S16_LE:
case AFMT_S16_BE:
case AFMT_U16_LE:
case AFMT_U16_BE:
sh_audio->samplesize = 2;
break;
default:
sh_audio->samplesize = 1;
}
w->wBitsPerSample = sh_audio->samplesize*8;
w->nChannels = sh_audio->channels = xmms_channels;
w->nSamplesPerSec = sh_audio->samplerate = xmms_samplerate;
w->nAvgBytesPerSec = xmms_samplerate*sh_audio->channels*sh_audio->samplesize;
w->nBlockAlign = sh_audio->samplesize*sh_audio->channels;
w->cbSize = 0;
return 1;
}
int demux_xmms_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) {
sh_audio_t *sh_audio = demuxer->audio->sh;
xmms_priv_t *priv=demuxer->priv;
demux_packet_t* dp;
while (xmms_audiopos<XMMS_PACKETSIZE/2) {
if(priv->ip->get_time()<0) return 0;
usleep(1000);
}
pthread_mutex_lock(&xmms_mutex);
dp = new_demux_packet(XMMS_PACKETSIZE/2);
ds->pts = priv->spos / (float)(sh_audio->wf->nAvgBytesPerSec);
ds->pos = priv->spos;
priv->spos+=XMMS_PACKETSIZE/2;
memcpy(dp->buffer,xmms_audiobuffer,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);
ds_add_packet(ds,dp);
return 1;
}
void demux_xmms_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
stream_t* s = demuxer->stream;
sh_audio_t* sh_audio = demuxer->audio->sh;
xmms_priv_t *priv=demuxer->priv;
float pos;
if(priv->ip->get_time()<0) return;
pos = (flags & 1) ? 0 : priv->spos / (float)(sh_audio->wf->nAvgBytesPerSec);
if (flags & 2)
pos+= rel_seek_secs*xmms_length;
else
pos+= rel_seek_secs;
if (pos<0) pos=0;
if (pos>=xmms_length) pos=xmms_length-1;
priv->ip->seek((pos<0)?0:(int)pos);
priv->spos=pos * (float)(sh_audio->wf->nAvgBytesPerSec);;
}
int demux_close_xmms(demuxer_t* demuxer) {
xmms_priv_t *priv=demuxer->priv;
priv->ip->stop();
free(priv); demuxer->priv=NULL;
cleanup_plugins();
return 1;
}
int demux_xmms_control(demuxer_t *demuxer,int cmd, void *arg){
demux_stream_t *d_video=demuxer->video;
sh_audio_t *sh_audio=demuxer->audio->sh;
xmms_priv_t *priv=demuxer->priv;
switch(cmd) {
case DEMUXER_CTRL_GET_TIME_LENGTH:
if (xmms_length<=0) return DEMUXER_CTRL_DONTKNOW;
*((unsigned long *)arg)=(unsigned long)xmms_length/1000;
return DEMUXER_CTRL_GUESS;
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 );
return DEMUXER_CTRL_OK;
default:
return DEMUXER_CTRL_NOTIMPL;
}
}
--- NEW FILE ---
/* XMMS - Cross-platform multimedia player
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. 2.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef PLUGIN_H
#define PLUGIN_H
typedef enum
{
FMT_U8, FMT_S8, FMT_U16_LE, FMT_U16_BE, FMT_U16_NE, FMT_S16_LE, FMT_S16_BE, FMT_S16_NE
}
AFormat;
typedef struct
{
void *handle; /* Filled in by xmms */
char *filename; /* Filled in by xmms */
char *description; /* The description that is shown in the preferences box */
void (*init) (void);
void (*about) (void); /* Show the about box */
void (*configure) (void); /* Show the configuration dialog */
void (*get_volume) (int *l, int *r);
void (*set_volume) (int l, int r); /* Set the volume */
int (*open_audio) (AFormat fmt, int rate, int nch); /* Open the device, if the device can't handle the given
parameters the plugin is responsible for downmixing
the data to the right format before outputting it */
void (*write_audio) (void *ptr, int length); /* The input plugin calls this to write data to the output
buffer */
void (*close_audio) (void); /* No comment... */
void (*flush) (int time); /* Flush the buffer and set the plugins internal timers to time */
void (*pause) (short paused); /* Pause or unpause the output */
int (*buffer_free) (void); /* Return the amount of data that can be written to the buffer,
two calls to this without a call to write_audio should make
the plugin output audio directly */
int (*buffer_playing) (void); /* Returns TRUE if the plugin currently is playing some audio,
otherwise return FALSE */
int (*output_time) (void); /* Return the current playing time */
int (*written_time) (void); /* Return the length of all the data that has been written to
the buffer */
}
OutputPlugin;
typedef struct
{
void *handle; /* Filled in by xmms */
char *filename; /* Filled in by xmms */
char *description; /* The description that is shown in the preferences box */
void (*init) (void); /* Called when the plugin is loaded */
void (*cleanup) (void); /* Called when the plugin is unloaded */
void (*about) (void); /* Show the about box */
void (*configure) (void); /* Show the configure box */
int (*mod_samples) (void *data, int length, AFormat fmt, int srate, int nch); /* Modify samples */
void (*query_format) (AFormat *fmt,int *rate, int *nch);
}
EffectPlugin;
typedef enum
{
INPUT_VIS_ANALYZER, INPUT_VIS_SCOPE, INPUT_VIS_VU, INPUT_VIS_OFF
}
InputVisType;
typedef struct
{
void *handle; /* Filled in by xmms */
char *filename; /* Filled in by xmms */
char *description; /* The description that is shown in the preferences box */
void (*init) (void); /* Called when the plugin is loaded */
void (*about) (void); /* Show the about box */
void (*configure) (void);
int (*is_our_file) (char *filename); /* Return 1 if the plugin can handle the file */
void *(*scan_dir) (char *dirname); /* Look in Input/cdaudio/cdaudio.c to see how */
/* to use this */
void (*play_file) (char *filename); /* Guess what... */
void (*stop) (void); /* Tricky one */
void (*pause) (short paused); /* Pause or unpause */
void (*seek) (int time); /* Seek to the specified time */
void (*set_eq) (int on, float preamp, float *bands); /* Set the equalizer, most plugins won't be able to do this */
int (*get_time) (void); /* Get the time, usually returns the output plugins output time */
void (*get_volume) (int *l, int *r); /* Input-plugin specific volume functions, just provide a NULL if */
void (*set_volume) (int l, int r); /* you want the output plugin to handle it */
void (*cleanup) (void); /* Called when xmms exit */
InputVisType (*get_vis_type) (void); /* OBSOLETE, DO NOT USE! */
void (*add_vis_pcm) (int time, AFormat fmt, int nch, int length, void *ptr); /* Send data to the visualization plugins
Preferably 512 samples/block */
void (*set_info) (char *title, int length, int rate, int freq, int nch); /* Fill in the stuff that is shown in the player window
set length to -1 if it's unknown. Filled in by xmms */
void (*set_info_text) (char *text); /* Show some text in the song title box in the main window,
call it with NULL as argument to reset it to the song title.
Filled in by xmms */
void (*get_song_info) (char *filename, char **title, int *length); /* Function to grab the title string */
void (*file_info_box) (char *filename); /* Bring up an info window for the filename passed in */
OutputPlugin *output; /* Handle to the current output plugin. Filled in by xmms */
}
InputPlugin;
/* So that input plugins can get the title formatting information */
char *xmms_get_gentitle_format(void);
/* So that output plugins can communicate with effect plugins */
EffectPlugin *get_current_effect_plugin(void);
int effects_enabled(void);
typedef struct
{
void *handle; /* Filled in by xmms */
char *filename; /* Filled in by xmms */
int xmms_session; /* The session ID for attaching to the control socket */
char *description; /* The description that is shown in the preferences box */
void (*init) (void); /* Called when the plugin is enabled */
void (*about) (void); /* Show the about box */
void (*configure) (void);
void (*cleanup) (void); /* Called when the plugin is disabled or when xmms exits */
}
GeneralPlugin;
typedef struct _VisPlugin
{
void *handle; /* Filled in by xmms */
char *filename; /* Filled in by xmms */
int xmms_session; /* The session ID for attaching to the control socket */
char *description; /* The description that is shown in the preferences box */
int num_pcm_chs_wanted; /* Numbers of PCM channels wanted in the call to render_pcm */
int num_freq_chs_wanted; /* Numbers of freq channels wanted in the call to render_freq */
void (*init)(void); /* Called when the plugin is enabled */
void (*cleanup)(void); /* Called when the plugin is disabled */
void (*about)(void); /* Show the about box */
void (*configure)(void); /* Show the configure box */
void (*disable_plugin)(struct _VisPlugin *); /* Call this with a pointer to your plugin to disable the plugin */
void (*playback_start)(void); /* Called when playback starts */
void (*playback_stop)(void); /* Called when playback stops */
void (*render_pcm)(short pcm_data[2][512]); /* Render the PCM data, don't do anything time consuming in here */
void (*render_freq)(short freq_data[2][256]); /* Render the freq data, don't do anything time consuming in here */
} VisPlugin;
#endif
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- Makefile 23 Oct 2002 18:20:13 -0000 1.42
+++ Makefile 22 Dec 2002 21:01:01 -0000 1.43
@@ -4,6 +4,9 @@
include ../config.mak
SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c aviwrite.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c
+ifeq ($(XMMS_PLUGINS),yes)
+SRCS += demux_xmms.c
+endif
ifeq ($(STREAMING),yes)
SRCS += asf_streaming.c url.c http.c network.c asf_mmst_streaming.c
ifeq ($(STREAMING_LIVE_DOT_COM),yes)
@@ -20,7 +23,7 @@
OBJS = $(SRCS:.c=.o)
OBJS += $(CPLUSPLUSSRCS:.cpp=.o)
INCLUDE = -I../loader $(CSS_INC) $(EXTRA_INC)
-CFLAGS = $(OPTFLAGS) $(INCLUDE)
+CFLAGS = $(OPTFLAGS) $(INCLUDE) $(XMMS_CFLAGS)
CPLUSPLUSFLAGS = $(CFLAGS) $(CPLUSPLUSINCLUDE)
CPLUSPLUS = $(CC)
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- demuxer.c 11 Dec 2002 20:48:51 -0000 1.125
+++ demuxer.c 22 Dec 2002 21:01:01 -0000 1.126
@@ -132,6 +132,7 @@
extern void demux_close_rawdv(demuxer_t* demuxer);
extern void demux_close_pva(demuxer_t* demuxer);
extern void demux_close_smjpeg(demuxer_t* demuxer);
+extern void demux_close_xmms(demuxer_t* demuxer);
#ifdef USE_TV
#include "tv.h"
@@ -194,6 +195,11 @@
case DEMUXER_TYPE_AVI_NI:
case DEMUXER_TYPE_AVI_NINI:
demux_close_avi(demuxer); return;
+#ifdef HAVE_XMMS
+ case DEMUXER_TYPE_XMMS:
+ demux_close_xmms(demuxer); break;
+#endif
+
}
// free streams:
for(i=0;i<256;i++){
@@ -269,6 +275,7 @@
int demux_y4m_fill_buffer(demuxer_t *demux);
int demux_audio_fill_buffer(demux_stream_t *ds);
int demux_pva_fill_buffer(demuxer_t *demux);
+int demux_xmms_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
extern int demux_ogg_fill_buffer(demuxer_t *d);
@@ -303,6 +310,9 @@
#endif
case DEMUXER_TYPE_Y4M: return demux_y4m_fill_buffer(demux);
case DEMUXER_TYPE_AUDIO: return demux_audio_fill_buffer(ds);
+#ifdef HAVE_XMMS
+ case DEMUXER_TYPE_XMMS: return demux_xmms_fill_buffer(demux,ds);
+#endif
case DEMUXER_TYPE_DEMUXERS: return demux_demuxers_fill_buffer(demux,ds);
#ifdef HAVE_OGGVORBIS
case DEMUXER_TYPE_OGG: return demux_ogg_fill_buffer(demux);
@@ -533,6 +543,7 @@
extern int smjpeg_check_file(demuxer_t *demuxer);
extern int demux_open_smjpeg(demuxer_t* demuxer);
extern int bmp_check_file(demuxer_t *demuxer);
+extern int demux_xmms_open(demuxer_t* demuxer);
extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer);
@@ -850,6 +861,19 @@
demuxer = NULL;
}
}
+#ifdef HAVE_XMMS
+//=============== Try to open as XMMS file: =================
+if(file_format==DEMUXER_TYPE_UNKNOWN){
+ demuxer=new_demuxer(stream,DEMUXER_TYPE_XMMS,audio_id,video_id,dvdsub_id);
+ if(demux_xmms_open(demuxer)){
+ mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAudiofile);
+ file_format=DEMUXER_TYPE_XMMS;
+ } else {
+ free_demuxer(demuxer);
+ demuxer = NULL;
+ }
+}
+#endif
//=============== Try to open as a RTP stream: ===========
if(file_format==DEMUXER_TYPE_RTP) {
demuxer=new_demuxer(stream,DEMUXER_TYPE_RTP,audio_id,video_id,dvdsub_id);
@@ -1107,6 +1131,7 @@
extern void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
extern void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
extern void demux_rawaudio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
+extern void demux_xmms_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
demux_stream_t *d_audio=demuxer->audio;
@@ -1188,6 +1213,10 @@
#endif
case DEMUXER_TYPE_RAWAUDIO:
demux_rawaudio_seek(demuxer,rel_seek_secs,flags); break;
+#ifdef HAVE_XMMS
+ case DEMUXER_TYPE_XMMS:
+ demux_xmms_seek(demuxer,rel_seek_secs,flags); break;
+#endif
} // switch(demuxer->file_format)
@@ -1248,6 +1277,7 @@
extern int demux_mpg_control(demuxer_t *demuxer, int cmd, void *arg);
extern int demux_asf_control(demuxer_t *demuxer, int cmd, void *arg);
extern int demux_avi_control(demuxer_t *demuxer, int cmd, void *arg);
+extern int demux_xmms_control(demuxer_t *demuxer, int cmd, void *arg);
int demux_control(demuxer_t *demuxer, int cmd, void *arg) {
switch(demuxer->type) {
@@ -1260,7 +1290,10 @@
case DEMUXER_TYPE_AVI_NI:
case DEMUXER_TYPE_AVI_NINI:
return demux_avi_control(demuxer,cmd,arg);
-
+#ifdef HAVE_XMMS
+ case DEMUXER_TYPE_XMMS:
+ return demux_xmms_control(demuxer,cmd,arg);
+#endif
default:
return DEMUXER_CTRL_NOTIMPL;
}
Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- demuxer.h 16 Nov 2002 03:42:14 -0000 1.51
+++ demuxer.h 22 Dec 2002 21:01:01 -0000 1.52
@@ -33,6 +33,7 @@
#define DEMUXER_TYPE_RAWDV 22
#define DEMUXER_TYPE_PVA 23
#define DEMUXER_TYPE_SMJPEG 24
+#define DEMUXER_TYPE_XMMS 25
// This should always match the higest demuxer type number.
// Unless you want to disallow users to force the demuxer to some types
Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- open.c 6 Nov 2002 23:54:26 -0000 1.63
+++ open.c 22 Dec 2002 21:01:01 -0000 1.64
@@ -526,6 +526,7 @@
stream=new_stream(f,STREAMTYPE_FILE);
stream->end_pos=len;
+ stream->url=filename?strdup(filename):NULL;
return stream;
}
4
3
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv436
Modified Files:
mplayer.c
Log Message:
The patch adds support for a per-file config, which is loaded before
playing the file. The config file is looked for in the same directory
as the input file, and in the ~/.mplayer dir.
Magne Oestlyngen <ml(a)skybert.org>
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.634
retrieving revision 1.635
diff -u -r1.634 -r1.635
--- mplayer.c 28 Dec 2002 14:17:38 -0000 1.634
+++ mplayer.c 28 Dec 2002 14:29:41 -0000 1.635
@@ -521,6 +521,39 @@
}
}
+void load_per_file_config (m_config_t* conf, const char *const file)
+{
+ char *confpath;
+ char cfg[PATH_MAX];
+ struct stat st;
+ char *name;
+
+ sprintf (cfg, "%s.conf", file);
+
+ if (!stat (cfg, &st))
+ {
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"Loading config '%s'\n", cfg);
+ m_config_parse_config_file (conf, cfg);
+ return;
+ }
+
+ if ((name = strrchr (cfg, '/')) == NULL)
+ name = cfg;
+ else
+ name++;
+
+ if ((confpath = get_path (name)) != NULL)
+ {
+ if (!stat (confpath, &st))
+ {
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"Loading config '%s'\n", confpath);
+ m_config_parse_config_file (conf, confpath);
+ }
+
+ free (confpath);
+ }
+}
+
// When libmpdemux perform a blocking operation (network connection or cache filling)
// if the operation fail we use this function to check if it was interrupted by the user.
// The function return a new value for eof.
@@ -970,6 +1003,8 @@
// ******************* Now, let's see the per-file stuff ********************
play_next_file:
+
+ if (filename) load_per_file_config (mconfig, filename);
// We must enable getch2 here to be able to interrupt network connection
// or cache filling
5
9
Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var/tmp.root/cvs-serv24161
Modified Files:
radeon_vid.c
Log Message:
the long awaited pink screen + shift fix for radeon, based on patch by Svante Signell <svante.signell(a)telia.com>, Carl (mlist.mplayer.users(a)urs.us) and Nick Kurshve <nickolsk(a)yandex.ru>
Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/radeon_vid.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- radeon_vid.c 20 Nov 2002 15:48:34 -0000 1.53
+++ radeon_vid.c 22 Dec 2002 14:59:41 -0000 1.54
@@ -23,13 +23,17 @@
#define X_ADJUST 0
#else
#define RADEON_MSG "Radeon_vid:"
-#define X_ADJUST (!IsR200 ? 8 : 0)
+#define X_ADJUST (is_shift_required ? 8 : 0)
#ifndef RADEON
#define RADEON
#endif
#endif
static int __verbose = 0;
+#ifdef RADEON
+static int rage_ckey_model=0;
+static int is_shift_required;
+#endif
typedef struct bes_registers_s
{
@@ -927,6 +931,30 @@
printf(RADEON_MSG" Video memory = %uMb\n",radeon_ram_size/0x100000);
err = mtrr_set_type(pci_info.base0,radeon_ram_size,MTRR_TYPE_WRCOMB);
if(!err) printf(RADEON_MSG" Set write-combining type of video memory\n");
+
+#ifdef RADEON
+ switch(def_cap.device_id)
+ {
+ case DEVICE_ATI_RADEON_QW:
+ case DEVICE_ATI_RADEON_MOBILITY_M6:
+ case DEVICE_ATI_RADEON_MOBILITY_M62:
+ case DEVICE_ATI_RADEON_MOBILITY_M63:
+ case DEVICE_ATI_RADEON_MOBILITY_M64:
+ rage_ckey_model=1;
+ is_shift_required=1;
+ break;
+ case DEVICE_ATI_RADEON_QD:
+ case DEVICE_ATI_RADEON_QE:
+ case DEVICE_ATI_RADEON_QF:
+ case DEVICE_ATI_RADEON_QG:
+ case DEVICE_ATI_RADEON_VE_QY:
+ case DEVICE_ATI_RADEON_VE_QZ:
+ is_shift_required=1;
+ break;
+ default: break;
+ }
+#endif
+
if(__verbose > 1) radeon_vid_dump_regs();
return 0;
}
@@ -1678,7 +1706,11 @@
besr.ckey_cntl = VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_NE|CMP_MIX_AND;
#else
besr.graphics_key_msk=besr.graphics_key_clr;
- besr.ckey_cntl = VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_EQ|CMP_MIX_AND;
+ besr.ckey_cntl = VIDEO_KEY_FN_TRUE|CMP_MIX_AND;
+ if(rage_ckey_model)
+ besr.ckey_cntl |= GRAPHIC_KEY_FN_NE;
+ else
+ besr.ckey_cntl |= GRAPHIC_KEY_FN_EQ;
#endif
}
else
2
1
CVS: main/libaf af_comp.c,NONE,1.1 af_gate.c,NONE,1.1 af_pan.c,NONE,1.1 af_resample.h,NONE,1.1 af_tools.c,NONE,1.1 Makefile,1.6,1.7 af.c,1.19,1.20 af.h,1.12,1.13 af_channels.c,1.8,1.9 af_delay.c,1.8,1.9 af_equalizer.c,1.2,1.3 af_format.c,1.9,1.10 af_resample.c,1.15,1.16 af_volume.c,1.5,1.6 control.h,1.3,1.4
by Anders Johansson CVS 04 Jan '03
by Anders Johansson CVS 04 Jan '03
04 Jan '03
Update of /cvsroot/mplayer/main/libaf
In directory mail:/var/tmp.root/cvs-serv18447
Modified Files:
Makefile af.c af.h af_channels.c af_delay.c af_equalizer.c
af_format.c af_resample.c af_volume.c control.h
Added Files:
af_comp.c af_gate.c af_pan.c af_resample.h af_tools.c
Log Message:
Changes includes:
- Improved runtime control system
- 3 New filter panning, compressor/limiter and a noise gate
- The compressor/limiter and the noise gate are not yet finished
- The panning filter does combined mixing and channel routing and
can be used to down-mix from stereo to mono (for example)
- Improvements to volume and channel
- volume now has a very good soft clipping using sin()
- channel can handle generic routing of audio data
- Conversion of all filters to handle floating point data
- Cleanup of message printing
- Fix for the sig 11 bug reported by Denes
--- NEW FILE ---
/*=============================================================================
//
// This software has been released under the terms of the GNU Public
// license. See http://www.gnu.org/copyleft/gpl.html for details.
//
// Copyright 2002 Anders Johansson ajh(a)atri.curtin.edu.au
//
//=============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include "af.h"
// Data for specific instances of this filter
typedef struct af_comp_s
{
int enable[AF_NCH]; // Enable/disable / channel
float time[AF_NCH]; // Forgetting factor for power estimate
float pow[AF_NCH]; // Estimated power level [dB]
float tresh[AF_NCH]; // Threshold [dB]
float attack[AF_NCH]; // Attack time [ms]
float release[AF_NCH]; // Release time [ms]
float ratio[AF_NCH]; // Compression ratio
}af_comp_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
af_comp_t* s = (af_comp_t*)af->setup;
int i;
switch(cmd){
case AF_CONTROL_REINIT:
// Sanity check
if(!arg) return AF_ERROR;
af->data->rate = ((af_data_t*)arg)->rate;
af->data->nch = ((af_data_t*)arg)->nch;
af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
af->data->bps = 4;
// Time constant set to 0.1s
// s->alpha = (1.0/0.2)/(2.0*M_PI*(float)((af_data_t*)arg)->rate);
return af_test_output(af,(af_data_t*)arg);
case AF_CONTROL_COMMAND_LINE:{
/* float v=-10.0; */
/* float vol[AF_NCH]; */
/* float s=0.0; */
/* float clipp[AF_NCH]; */
/* int i; */
/* sscanf((char*)arg,"%f:%f", &v, &s); */
/* for(i=0;i<AF_NCH;i++){ */
/* vol[i]=v; */
/* clipp[i]=s; */
/* } */
/* if(AF_OK != control(af,AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_SET, clipp)) */
/* return AF_ERROR; */
/* return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol); */
}
case AF_CONTROL_COMP_ON_OFF | AF_CONTROL_SET:
memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int));
return AF_OK;
case AF_CONTROL_COMP_ON_OFF | AF_CONTROL_GET:
memcpy((int*)arg,s->enable,AF_NCH*sizeof(int));
return AF_OK;
case AF_CONTROL_COMP_THRESH | AF_CONTROL_SET:
return af_from_dB(AF_NCH,(float*)arg,s->tresh,20.0,-60.0,-1.0);
case AF_CONTROL_COMP_THRESH | AF_CONTROL_GET:
return af_to_dB(AF_NCH,s->tresh,(float*)arg,10.0);
case AF_CONTROL_COMP_ATTACK | AF_CONTROL_SET:
return af_from_ms(AF_NCH,(float*)arg,s->attack,af->data->rate,500.0,0.1);
case AF_CONTROL_COMP_ATTACK | AF_CONTROL_GET:
return af_to_ms(AF_NCH,s->attack,(float*)arg,af->data->rate);
case AF_CONTROL_COMP_RELEASE | AF_CONTROL_SET:
return af_from_ms(AF_NCH,(float*)arg,s->release,af->data->rate,3000.0,10.0);
case AF_CONTROL_COMP_RELEASE | AF_CONTROL_GET:
return af_to_ms(AF_NCH,s->release,(float*)arg,af->data->rate);
case AF_CONTROL_COMP_RATIO | AF_CONTROL_SET:
for(i=0;i<AF_NCH;i++)
s->ratio[i] = clamp(((float*)arg)[i],1.0,10.0);
return AF_OK;
case AF_CONTROL_COMP_RATIO | AF_CONTROL_GET:
for(i=0;i<AF_NCH;i++)
((float*)arg)[i] = s->ratio[i];
return AF_OK;
}
return AF_UNKNOWN;
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
{
if(af->data)
free(af->data);
if(af->setup)
free(af->setup);
}
// Filter data through filter
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
af_data_t* c = data; // Current working data
af_comp_t* s = (af_comp_t*)af->setup; // Setup for this instance
float* a = (float*)c->audio; // Audio data
int len = c->len/4; // Number of samples
int ch = 0; // Channel counter
register int nch = c->nch; // Number of channels
register int i = 0;
// Compress/expand
for(ch = 0; ch < nch ; ch++){
if(s->enable[ch]){
float t = 1.0 - s->time[ch];
for(i=ch;i<len;i+=nch){
register float x = a[i];
register float pow = x*x;
s->pow[ch] = t*s->pow[ch] +
pow*s->time[ch]; // LP filter
if(pow < s->pow[ch]){
;
}
else{
;
}
a[i] = x;
}
}
}
return c;
}
// Allocate memory and set function pointers
static int open(af_instance_t* af){
af->control=control;
af->uninit=uninit;
af->play=play;
af->mul.n=1;
af->mul.d=1;
af->data=calloc(1,sizeof(af_data_t));
af->setup=calloc(1,sizeof(af_comp_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
return AF_OK;
}
// Description of this filter
af_info_t af_info_comp = {
"Compressor/expander audio filter",
"comp",
"Anders",
"",
AF_FLAGS_NOT_REENTRANT,
open
};
--- NEW FILE ---
/*=============================================================================
//
// This software has been released under the terms of the GNU Public
// license. See http://www.gnu.org/copyleft/gpl.html for details.
//
// Copyright 2002 Anders Johansson ajh(a)atri.curtin.edu.au
//
//=============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include "af.h"
// Data for specific instances of this filter
typedef struct af_gate_s
{
int enable[AF_NCH]; // Enable/disable / channel
float time[AF_NCH]; // Forgetting factor for power estimate
float pow[AF_NCH]; // Estimated power level [dB]
float tresh[AF_NCH]; // Threshold [dB]
float attack[AF_NCH]; // Attack time [ms]
float release[AF_NCH]; // Release time [ms]
float range[AF_NCH]; // Range level [dB]
}af_gate_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
af_gate_t* s = (af_gate_t*)af->setup;
switch(cmd){
case AF_CONTROL_REINIT:
// Sanity check
if(!arg) return AF_ERROR;
af->data->rate = ((af_data_t*)arg)->rate;
af->data->nch = ((af_data_t*)arg)->nch;
af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
af->data->bps = 4;
// Time constant set to 0.1s
// s->alpha = (1.0/0.2)/(2.0*M_PI*(float)((af_data_t*)arg)->rate);
return af_test_output(af,(af_data_t*)arg);
case AF_CONTROL_COMMAND_LINE:{
/* float v=-10.0; */
/* float vol[AF_NCH]; */
/* float s=0.0; */
/* float clipp[AF_NCH]; */
/* int i; */
/* sscanf((char*)arg,"%f:%f", &v, &s); */
/* for(i=0;i<AF_NCH;i++){ */
/* vol[i]=v; */
/* clipp[i]=s; */
/* } */
/* if(AF_OK != control(af,AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_SET, clipp)) */
/* return AF_ERROR; */
/* return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol); */
}
case AF_CONTROL_GATE_ON_OFF | AF_CONTROL_SET:
memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int));
return AF_OK;
case AF_CONTROL_GATE_ON_OFF | AF_CONTROL_GET:
memcpy((int*)arg,s->enable,AF_NCH*sizeof(int));
return AF_OK;
case AF_CONTROL_GATE_THRESH | AF_CONTROL_SET:
return af_from_dB(AF_NCH,(float*)arg,s->tresh,20.0,-60.0,-1.0);
case AF_CONTROL_GATE_THRESH | AF_CONTROL_GET:
return af_to_dB(AF_NCH,s->tresh,(float*)arg,10.0);
case AF_CONTROL_GATE_ATTACK | AF_CONTROL_SET:
return af_from_ms(AF_NCH,(float*)arg,s->attack,af->data->rate,500.0,0.1);
case AF_CONTROL_GATE_ATTACK | AF_CONTROL_GET:
return af_to_ms(AF_NCH,s->attack,(float*)arg,af->data->rate);
case AF_CONTROL_GATE_RELEASE | AF_CONTROL_SET:
return af_from_ms(AF_NCH,(float*)arg,s->release,af->data->rate,3000.0,10.0);
case AF_CONTROL_GATE_RELEASE | AF_CONTROL_GET:
return af_to_ms(AF_NCH,s->release,(float*)arg,af->data->rate);
case AF_CONTROL_GATE_RANGE | AF_CONTROL_SET:
return af_from_dB(AF_NCH,(float*)arg,s->range,20.0,100.0,0.0);
case AF_CONTROL_GATE_RANGE | AF_CONTROL_GET:
return af_to_dB(AF_NCH,s->range,(float*)arg,10.0);
}
return AF_UNKNOWN;
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
{
if(af->data)
free(af->data);
if(af->setup)
free(af->setup);
}
// Filter data through filter
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
af_data_t* c = data; // Current working data
af_gate_t* s = (af_gate_t*)af->setup; // Setup for this instance
float* a = (float*)c->audio; // Audio data
int len = c->len/4; // Number of samples
int ch = 0; // Channel counter
register int nch = c->nch; // Number of channels
register int i = 0;
// Noise gate
for(ch = 0; ch < nch ; ch++){
if(s->enable[ch]){
float t = 1.0 - s->time[ch];
for(i=ch;i<len;i+=nch){
register float x = a[i];
register float pow = x*x;
s->pow[ch] = t*s->pow[ch] +
pow*s->time[ch]; // LP filter
if(pow < s->pow[ch]){
;
}
else{
;
}
a[i] = x;
}
}
}
return c;
}
// Allocate memory and set function pointers
static int open(af_instance_t* af){
af->control=control;
af->uninit=uninit;
af->play=play;
af->mul.n=1;
af->mul.d=1;
af->data=calloc(1,sizeof(af_data_t));
af->setup=calloc(1,sizeof(af_gate_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
return AF_OK;
}
// Description of this filter
af_info_t af_info_gate = {
"Noise gate audio filter",
"gate",
"Anders",
"",
AF_FLAGS_NOT_REENTRANT,
open
};
--- NEW FILE ---
/*=============================================================================
//
// This software has been released under the terms of the GNU Public
// license. See http://www.gnu.org/copyleft/gpl.html for details.
//
// Copyright 2002 Anders Johansson ajh(a)atri.curtin.edu.au
//
//=============================================================================
*/
/* */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include "af.h"
// Data for specific instances of this filter
typedef struct af_pan_s
{
float level[AF_NCH][AF_NCH]; // Gain level for each channel
}af_pan_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
af_pan_t* s = af->setup;
switch(cmd){
case AF_CONTROL_REINIT:
// Sanity check
if(!arg) return AF_ERROR;
af->data->rate = ((af_data_t*)arg)->rate;
af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
af->data->bps = 4;
af->mul.n = af->data->nch;
af->mul.d = ((af_data_t*)arg)->nch;
if((af->data->format != ((af_data_t*)arg)->format) ||
(af->data->bps != ((af_data_t*)arg)->bps)){
((af_data_t*)arg)->format = af->data->format;
((af_data_t*)arg)->bps = af->data->bps;
return AF_FALSE;
}
return control(af,AF_CONTROL_PAN_NOUT | AF_CONTROL_SET, &af->data->nch);
case AF_CONTROL_COMMAND_LINE:{
int nch = 0;
int n = 0;
char* cp = NULL;
int j,k;
// Read number of outputs
sscanf((char*)arg,"%i%n", &nch,&n);
if(AF_OK != control(af,AF_CONTROL_PAN_NOUT | AF_CONTROL_SET, &nch))
return AF_ERROR;
// Read pan values
cp = &((char*)arg)[n];
j = 0; k = 0;
while((*cp == ':') && (k < AF_NCH)){
sscanf(cp, ":%f%n" , &s->level[k][j], &n);
s->level[k][j] = clamp(s->level[k][j],0.0,1.0);
af_msg(AF_MSG_VERBOSE,"[pan] Pan level from channel %i to"
" channel %i = %f\n",j,k,s->level[k][j]);
cp =&cp[n];
j++;
if(j>=nch){
j = 0;
k++;
}
}
return AF_OK;
}
case AF_CONTROL_PAN_LEVEL | AF_CONTROL_SET:{
int i;
int ch = ((af_control_ext_t*)arg)->ch;
float* level = ((af_control_ext_t*)arg)->arg;
for(i=0;i<AF_NCH;i++)
s->level[ch][i] = clamp(level[i],0.0,1.0);
return AF_OK;
}
case AF_CONTROL_PAN_LEVEL | AF_CONTROL_GET:{
int i;
int ch = ((af_control_ext_t*)arg)->ch;
float* level = ((af_control_ext_t*)arg)->arg;
for(i=0;i<AF_NCH;i++)
level[i] = s->level[ch][i];
return AF_OK;
}
case AF_CONTROL_PAN_NOUT | AF_CONTROL_SET:
// Reinit must be called after this function has been called
// Sanity check
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > 6){
af_msg(AF_MSG_ERROR,"[pan] The number of output channels must be"
" between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
return AF_ERROR;
}
af->data->nch=((int*)arg)[0];
return AF_OK;
case AF_CONTROL_PAN_NOUT | AF_CONTROL_GET:
*(int*)arg = af->data->nch;
return AF_OK;
}
return AF_UNKNOWN;
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
{
if(af->data)
free(af->data);
if(af->setup)
free(af->setup);
}
// Filter data through filter
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
af_data_t* c = data; // Current working data
af_data_t* l = af->data; // Local data
af_pan_t* s = af->setup; // Setup for this instance
float* in = c->audio; // Input audio data
float* out = NULL; // Output audio data
float* end = in+c->len/4; // End of loop
int nchi = c->nch; // Number of input channels
int ncho = l->nch; // Number of output channels
register int j,k;
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
return NULL;
out = l->audio;
// Execute panning
// FIXME: Too slow
while(in < end){
for(j=0;j<ncho;j++){
register float x = 0.0;
register float* tin = in;
for(k=0;k<nchi;k++)
x += tin[k] * s->level[j][k];
out[j] = x;
}
out+= ncho;
in+= nchi;
}
// Set output data
c->audio = l->audio;
c->len = (c->len*af->mul.n)/af->mul.d;
c->nch = l->nch;
return c;
}
// Allocate memory and set function pointers
static int open(af_instance_t* af){
af->control=control;
af->uninit=uninit;
af->play=play;
af->mul.n=1;
af->mul.d=1;
af->data=calloc(1,sizeof(af_data_t));
af->setup=calloc(1,sizeof(af_pan_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
// Set initial pan to pass-through.
return AF_OK;
}
// Description of this filter
af_info_t af_info_pan = {
"Panning audio filter",
"pan",
"Anders",
"",
AF_FLAGS_NOT_REENTRANT,
open
};
--- NEW FILE ---
/*=============================================================================
//
// This software has been released under the terms of the GNU Public
// license. See http://www.gnu.org/copyleft/gpl.html for details.
//
// Copyright 2002 Anders Johansson ajh(a)atri.curtin.edu.au
//
//=============================================================================
*/
/* This file contains the resampling engine, the sample format is
controlled by the FORMAT parameter, the filter length by the L
parameter and the resampling type by UP and DN. This file should
only be included by af_resample.c
*/
#undef L
#undef SHIFT
#undef FORMAT
#undef FIR
#undef ADDQUE
/* The lenght Lxx definition selects the length of each poly phase
component. Valid definitions are L8 and L16 where the number
defines the nuber of taps. This definition affects the
computational complexity, the performance and the memory usage.
*/
/* The FORMAT_x parameter selects the sample format type currently
float and int16 are supported. Thes two formats are selected by
defining eiter FORMAT_F or FORMAT_I. The advantage of using float
is that the amplitude and therefore the SNR isn't affected by the
filtering, the disadvantage is that it is a lot slower.
*/
#if defined(FORMAT_I)
#define SHIFT >>16
#define FORMAT int16_t
#else
#define SHIFT
#define FORMAT float
#endif
// Short filter
#if defined(L8)
#define L 8 // Filter length
// Unrolled loop to speed up execution
#define FIR(x,w,y) \
(y[0]) = ( w[0]*x[0]+w[1]*x[1]+w[2]*x[2]+w[3]*x[3] \
+ w[4]*x[4]+w[5]*x[5]+w[6]*x[6]+w[7]*x[7] ) SHIFT
#else /* L8/L16 */
#define L 16
// Unrolled loop to speed up execution
#define FIR(x,w,y) \
y[0] = ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] \
+ w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] \
+ w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] \
+ w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ) SHIFT
#endif /* L8/L16 */
// Macro to add data to circular que
#define ADDQUE(xi,xq,in)\
xq[xi]=xq[xi+L]=(*in);\
xi=(xi-1)&(L-1);
#if defined(UP)
uint32_t ci = l->nch; // Index for channels
uint32_t nch = l->nch; // Number of channels
uint32_t inc = s->up/s->dn;
uint32_t level = s->up%s->dn;
uint32_t up = s->up;
uint32_t dn = s->dn;
uint32_t ns = c->len/l->bps;
register FORMAT* w = s->w;
register uint32_t wi = 0;
register uint32_t xi = 0;
// Index current channel
while(ci--){
// Temporary pointers
register FORMAT* x = s->xq[ci];
register FORMAT* in = ((FORMAT*)c->audio)+ci;
register FORMAT* out = ((FORMAT*)l->audio)+ci;
FORMAT* end = in+ns; // Block loop end
wi = s->wi; xi = s->xi;
while(in < end){
register uint32_t i = inc;
if(wi<level) i++;
ADDQUE(xi,x,in);
in+=nch;
while(i--){
// Run the FIR filter
FIR((&x[xi]),(&w[wi*L]),out);
len++; out+=nch;
// Update wi to point at the correct polyphase component
wi=(wi+dn)%up;
}
}
}
// Save values that needs to be kept for next time
s->wi = wi;
s->xi = xi;
#endif /* UP */
#if defined(DN) /* DN */
uint32_t ci = l->nch; // Index for channels
uint32_t nch = l->nch; // Number of channels
uint32_t inc = s->dn/s->up;
uint32_t level = s->dn%s->up;
uint32_t up = s->up;
uint32_t dn = s->dn;
uint32_t ns = c->len/l->bps;
FORMAT* w = s->w;
register int32_t i = 0;
register uint32_t wi = 0;
register uint32_t xi = 0;
// Index current channel
while(ci--){
// Temporary pointers
register FORMAT* x = s->xq[ci];
register FORMAT* in = ((FORMAT*)c->audio)+ci;
register FORMAT* out = ((FORMAT*)l->audio)+ci;
register FORMAT* end = in+ns; // Block loop end
i = s->i; wi = s->wi; xi = s->xi;
while(in < end){
ADDQUE(xi,x,in);
in+=nch;
if((--i)<=0){
// Run the FIR filter
FIR((&x[xi]),(&w[wi*L]),out);
len++; out+=nch;
// Update wi to point at the correct polyphase component
wi=(wi+dn)%up;
// Insert i number of new samples in queue
i = inc;
if(wi<level) i++;
}
}
}
// Save values that needs to be kept for next time
s->wi = wi;
s->xi = xi;
s->i = i;
#endif /* DN */
--- NEW FILE ---
#include <math.h>
#include <af.h>
/* Convert to gain value from dB. Returns AF_OK if of and AF_ERROR if
fail */
inline int af_from_dB(int n, float* in, float* out, float k, float mi, float ma)
{
int i = 0;
// Sanity check
if(!in || !out)
return AF_ERROR;
for(i=0;i<n;i++){
if(in[i]<=-200)
out[i]=0.0;
else
out[i]=pow(10.0,clamp(in[i],mi,ma)/k);
}
return AF_OK;
}
/* Convert from gain value to dB. Returns AF_OK if of and AF_ERROR if
fail */
inline int af_to_dB(int n, float* in, float* out, float k)
{
int i = 0;
// Sanity check
if(!in || !out)
return AF_ERROR;
for(i=0;i<AF_NCH;i++){
if(in[i] == 0.0)
out[i]=-200.0;
else
out[i]=k*log10(in[i]);
}
return AF_OK;
}
/* Convert from ms to sample time*/
inline int af_from_ms(int n, float* in, float* out, int rate, float mi, float ma)
{
int i = 0;
// Sanity check
if(!in || !out)
return AF_ERROR;
for(i=0;i<AF_NCH;i++)
out[i]=clamp(in[i],ma,mi);
return AF_OK;
}
/* Convert from sample time to ms */
inline int af_to_ms(int n, float* in, float* out, int rate)
{
int i = 0;
// Sanity check
if(!in || !out)
return AF_ERROR;
for(i=0;i<AF_NCH;i++)
out[i]=in[i];
return AF_OK;
}
/* Helper function for testing the output format */
inline int af_test_output(struct af_instance_s* af, af_data_t* out)
{
if((af->data->format != out->format) ||
(af->data->bps != out->bps) ||
(af->data->rate != out->rate) ||
(af->data->nch != out->nch)){
memcpy(out,af->data,sizeof(af_data_t));
return AF_FALSE;
}
return AF_OK;
}
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile 25 Nov 2002 02:19:27 -0000 1.6
+++ Makefile 28 Dec 2002 13:59:53 -0000 1.7
@@ -2,7 +2,7 @@
LIBNAME = libaf.a
-SRCS=af.c af_mp.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c window.c filter.c af_volume.c af_equalizer.c
+SRCS=af.c af_mp.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c window.c filter.c af_volume.c af_equalizer.c af_tools.c af_comp.c af_gate.c af_pan.c
OBJS=$(SRCS:.c=.o)
Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- af.c 12 Nov 2002 12:33:54 -0000 1.19
+++ af.c 28 Dec 2002 13:59:53 -0000 1.20
@@ -16,6 +16,9 @@
extern af_info_t af_info_resample;
extern af_info_t af_info_volume;
extern af_info_t af_info_equalizer;
+extern af_info_t af_info_gate;
+extern af_info_t af_info_comp;
+extern af_info_t af_info_pan;
static af_info_t* filter_list[]={ \
&af_info_dummy,\
@@ -25,6 +28,9 @@
&af_info_resample,\
&af_info_volume,\
&af_info_equalizer,\
+ &af_info_gate,\
+ &af_info_comp,\
+ &af_info_pan,\
NULL \
};
@@ -72,7 +78,7 @@
// Allocate space for the new filter and reset all pointers
af_instance_t* new=malloc(sizeof(af_instance_t));
if(!new){
- af_msg(AF_MSG_ERROR,"Could not allocate memory\n");
+ af_msg(AF_MSG_ERROR,"[libaf] Could not allocate memory\n");
return NULL;
}
memset(new,0,sizeof(af_instance_t));
@@ -88,13 +94,14 @@
non-reentrant */
if(new->info->flags & AF_FLAGS_NOT_REENTRANT){
if(af_get(s,name)){
- af_msg(AF_MSG_ERROR,"There can only be one instance of the filter '%s' in each stream\n",name);
+ af_msg(AF_MSG_ERROR,"[libaf] There can only be one instance of"
+ " the filter '%s' in each stream\n",name);
free(new);
return NULL;
}
}
- af_msg(AF_MSG_VERBOSE,"Adding filter %s \n",name);
+ af_msg(AF_MSG_VERBOSE,"[libaf] Adding filter %s \n",name);
// Initialize the new filter
if(AF_OK == new->info->open(new) &&
@@ -108,7 +115,8 @@
}
free(new);
- af_msg(AF_MSG_ERROR,"Couldn't create or open audio filter '%s'\n",name);
+ af_msg(AF_MSG_ERROR,"[libaf] Couldn't create or open audio filter '%s'\n",
+ name);
return NULL;
}
@@ -165,6 +173,9 @@
{
if(!af) return;
+ // Print friendly message
+ af_msg(AF_MSG_VERBOSE,"[libaf] Removing filter %s \n",af->info->name);
+
// Notify filter before changing anything
af->control(af,AF_CONTROL_PRE_DESTROY,0);
@@ -234,8 +245,9 @@
// Create format filter
if(NULL == (new = af_prepend(s,af,"format")))
return AF_ERROR;
- // Set output format
- if(AF_OK != (rv = new->control(new,AF_CONTROL_FORMAT,&in)))
+ // Set output bits per sample
+ if(AF_OK != (rv = new->control(new,AF_CONTROL_FORMAT_BPS,&in.bps)) ||
+ AF_OK != (rv = new->control(new,AF_CONTROL_FORMAT_FMT,&in.format)))
return rv;
// Initialize format filter
if(!new->prev)
@@ -245,8 +257,11 @@
if(AF_OK != (rv = new->control(new,AF_CONTROL_REINIT,&in)))
return rv;
}
- if(!new) // Should _never_ happen
+ if(!new){ // Should _never_ happen
+ af_msg(AF_MSG_ERROR,"[libaf] Unable to correct audio format. "
+ "This error should never uccur, please send bugreport.\n");
return AF_ERROR;
+ }
af=new;
}
break;
@@ -264,10 +279,17 @@
break;
}
default:
- af_msg(AF_MSG_ERROR,"Reinitialization did not work, audio filter '%s' returned error code %i\n",af->info->name,rv);
+ af_msg(AF_MSG_ERROR,"[libaf] Reinitialization did not work, audio"
+ " filter '%s' returned error code %i\n",af->info->name,rv);
return AF_ERROR;
}
- af=af->next;
+ // Check if there are any filters left in the list
+ if(NULL == af){
+ if(!af_append(s,s->first,"dummy"))
+ return -1;
+ }
+ else
+ af=af->next;
}while(af);
return AF_OK;
}
@@ -315,7 +337,7 @@
}
}
}
-
+
// Init filters
if(AF_OK != af_reinit(s,s->first))
return -1;
@@ -340,7 +362,8 @@
}
}
// Init the new filter
- if(!af || (AF_OK != af->control(af,AF_CONTROL_RESAMPLE,&(s->output.rate))))
+ if(!af || (AF_OK != af->control(af,AF_CONTROL_RESAMPLE_RATE,
+ &(s->output.rate))))
return -1;
if(AF_OK != af_reinit(s,af))
return -1;
@@ -368,7 +391,8 @@
else
af = s->last;
// Init the new filter
- if(!af ||(AF_OK != af->control(af,AF_CONTROL_FORMAT,&(s->output))))
+ if(!af ||(AF_OK != af->control(af,AF_CONTROL_FORMAT_BPS,&(s->output.bps)))
+ || (AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT,&(s->output.format))))
return -1;
if(AF_OK != af_reinit(s,af))
return -1;
@@ -383,7 +407,8 @@
(s->last->data->nch != s->output.nch) ||
(s->last->data->rate != s->output.rate)) {
// Something is stuffed audio out will not work
- af_msg(AF_MSG_ERROR,"Unable to setup filter system can not meet sound-card demands, please report this error on MPlayer development mailing list. \n");
+ af_msg(AF_MSG_ERROR,"[libaf] Unable to setup filter system can not"
+ " meet sound-card demands, please send bugreport. \n");
af_uninit(s);
return -1;
}
@@ -493,6 +518,10 @@
mul.d *= af->mul.d;
af=af->next;
}while(af);
+ // Sanity check
+ if(!mul.n || !mul.d)
+ return -1;
+
in = t * (((len/t) * mul.d - 1)/mul.n);
if(in>max_insize) in=t*(max_insize/t);
@@ -531,14 +560,15 @@
{
// Calculate new length
register int len = af_lencalc(af->mul,data);
- af_msg(AF_MSG_VERBOSE,"Reallocating memory in module %s, old len = %i, new len = %i\n",af->info->name,af->data->len,len);
+ af_msg(AF_MSG_VERBOSE,"[libaf] Reallocating memory in module %s, "
+ "old len = %i, new len = %i\n",af->info->name,af->data->len,len);
// If there is a buffer free it
if(af->data->audio)
free(af->data->audio);
// Create new buffer and check that it is OK
af->data->audio = malloc(len);
if(!af->data->audio){
- af_msg(AF_MSG_FATAL,"Could not allocate memory \n");
+ af_msg(AF_MSG_FATAL,"[libaf] Could not allocate memory \n");
return AF_ERROR;
}
af->data->len=len;
Index: af.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- af.h 13 Nov 2002 09:09:50 -0000 1.12
+++ af.h 28 Dec 2002 13:59:53 -0000 1.13
@@ -180,6 +180,19 @@
needed */
int af_lencalc(frac_t mul, af_data_t* data);
+/* Helper function used to convert to gain value from dB. Returns
+ AF_OK if of and AF_ERROR if fail */
+int af_from_dB(int n, float* in, float* out, float k, float mi, float ma);
+/* Helper function used to convert from gain value to dB. Returns
+ AF_OK if of and AF_ERROR if fail */
+int af_to_dB(int n, float* in, float* out, float k);
+/* Helper function used to convert from ms to sample time*/
+int af_from_ms(int n, float* in, float* out, int rate, float mi, float ma);
+/* Helper function used to convert from sample time to ms */
+int af_to_ms(int n, float* in, float* out, int rate);
+/* Helper function for testing the output format */
+int af_test_output(struct af_instance_s* af, af_data_t* out);
+
/* Memory reallocation macro: if a local buffer is used (i.e. if the
filter doesn't operate on the incoming buffer this macro must be
called to ensure the buffer is big enough. */
Index: af_channels.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_channels.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- af_channels.c 12 Nov 2002 12:33:54 -0000 1.8
+++ af_channels.c 28 Dec 2002 13:59:53 -0000 1.9
@@ -10,6 +10,15 @@
#include "af.h"
+#define FR 0
+#define TO 1
+
+typedef struct af_channels_s{
+ int route[AF_NCH][2];
+ int nr;
+ int router;
+}af_channels_t;
+
// Local function for copying data
void copy(void* in, void* out, int ins, int inos,int outs, int outos, int len, int bps)
{
@@ -67,41 +76,140 @@
break;
}
default:
- af_msg(AF_MSG_ERROR,"[channels] Unsupported number of bytes/sample: %i please report this error on the MPlayer mailing list. \n",bps);
+ af_msg(AF_MSG_ERROR,"[channels] Unsupported number of bytes/sample: %i"
+ " please report this error on the MPlayer mailing list. \n",bps);
+ }
+}
+
+// Make sure the routes are sane
+static int check_routes(af_channels_t* s, int nin, int nout)
+{
+ int i;
+ if((s->nr < 1) || (s->nr > AF_NCH)){
+ af_msg(AF_MSG_ERROR,"[channels] The number of routing pairs musst be"
+ " between 1 and %i. Current value is %i\n",AF_NCH,s->nr);
+ return AF_ERROR;
+ }
+
+ for(i=0;i<s->nr;i++){
+ if((s->route[i][FR] >= nin) || (s->route[i][TO] >= nout)){
+ af_msg(AF_MSG_ERROR,"[channels] Invalid routing in pair nr. %i.\n", i);
+ return AF_ERROR;
+ }
}
+ return AF_OK;
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
+ af_channels_t* s = af->setup;
switch(cmd){
case AF_CONTROL_REINIT:
- // Make sure this filter isn't redundant
- if(af->data->nch == ((af_data_t*)arg)->nch)
- return AF_DETACH;
+
+ // Set default channel assignment
+ if(!s->router){
+ int i;
+ // Make sure this filter isn't redundant
+ if(af->data->nch == ((af_data_t*)arg)->nch)
+ return AF_DETACH;
+
+ // If mono: fake stereo
+ if(((af_data_t*)arg)->nch == 1){
+ s->nr = min(af->data->nch,2);
+ for(i=0;i<s->nr;i++){
+ s->route[i][FR] = 0;
+ s->route[i][TO] = i;
+ }
+ }
+ else{
+ s->nr = min(af->data->nch, ((af_data_t*)arg)->nch);
+ for(i=0;i<s->nr;i++){
+ s->route[i][FR] = i;
+ s->route[i][TO] = i;
+ }
+ }
+ }
af->data->rate = ((af_data_t*)arg)->rate;
af->data->format = ((af_data_t*)arg)->format;
af->data->bps = ((af_data_t*)arg)->bps;
af->mul.n = af->data->nch;
af->mul.d = ((af_data_t*)arg)->nch;
- return AF_OK;
+ return check_routes(s,((af_data_t*)arg)->nch,af->data->nch);
case AF_CONTROL_COMMAND_LINE:{
int nch = 0;
- sscanf((char*)arg,"%i",&nch);
- return af->control(af,AF_CONTROL_CHANNELS,&nch);
- }
- case AF_CONTROL_CHANNELS:
+ int n = 0;
+ // Check number of channels and number of routing pairs
+ sscanf(arg, "%i:%i%n", &nch, &s->nr, &n);
+
+ // If router scan commandline for routing pairs
+ if(s->nr){
+ char* cp = &((char*)arg)[n];
+ int ch = 0;
+ // Sanity check
+ if((s->nr < 1) || (s->nr > AF_NCH)){
+ af_msg(AF_MSG_ERROR,"[channels] The number of routing pairs musst be"
+ " between 1 and %i. Current value is %i\n",AF_NCH,s->nr);
+ }
+ s->router = 1;
+ // Scan for pairs on commandline
+ while((*cp == ':') && (ch < s->nr)){
+ sscanf(cp, ":%i:%i%n" ,&s->route[ch][FR], &s->route[ch][TO], &n);
+ af_msg(AF_MSG_DEBUG0,"[channels] Routing from channel %i to"
+ " channel %i\n",s->route[ch][FR],s->route[ch][TO]);
+ cp = &cp[n];
+ ch++;
+ }
+ }
+
+ if(AF_OK != af->control(af,AF_CONTROL_CHANNELS | AF_CONTROL_SET ,&nch))
+ return AF_ERROR;
+ return AF_OK;
+ }
+ case AF_CONTROL_CHANNELS | AF_CONTROL_SET:
// Reinit must be called after this function has been called
// Sanity check
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > 6){
- af_msg(AF_MSG_ERROR,"[channels] The number of output channels must be between 1 and 6. Current value is%i \n",((int*)arg)[0]);
+ af_msg(AF_MSG_ERROR,"[channels] The number of output channels must be"
+ " between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
return AF_ERROR;
}
af->data->nch=((int*)arg)[0];
- af_msg(AF_MSG_VERBOSE,"[channels] Changing number of channels to %i\n",af->data->nch);
+ if(!s->router)
+ af_msg(AF_MSG_VERBOSE,"[channels] Changing number of channels"
+ " to %i\n",af->data->nch);
+ return AF_OK;
+ case AF_CONTROL_CHANNELS | AF_CONTROL_GET:
+ *(int*)arg = af->data->nch;
+ return AF_OK;
+ case AF_CONTROL_CHANNELS_ROUTING | AF_CONTROL_SET:{
+ int ch = ((af_control_ext_t*)arg)->ch;
+ int* route = ((af_control_ext_t*)arg)->arg;
+ s->route[ch][FR] = route[FR];
+ s->route[ch][TO] = route[TO];
+ return AF_OK;
+ }
+ case AF_CONTROL_CHANNELS_ROUTING | AF_CONTROL_GET:{
+ int ch = ((af_control_ext_t*)arg)->ch;
+ int* route = ((af_control_ext_t*)arg)->arg;
+ route[FR] = s->route[ch][FR];
+ route[TO] = s->route[ch][TO];
+ return AF_OK;
+ }
+ case AF_CONTROL_CHANNELS_NR | AF_CONTROL_SET:
+ s->nr = *(int*)arg;
+ return AF_OK;
+ case AF_CONTROL_CHANNELS_NR | AF_CONTROL_GET:
+ *(int*)arg = s->nr;
+ return AF_OK;
+ case AF_CONTROL_CHANNELS_ROUTER | AF_CONTROL_SET:
+ s->router = *(int*)arg;
+ return AF_OK;
+ case AF_CONTROL_CHANNELS_ROUTER | AF_CONTROL_GET:
+ *(int*)arg = s->router;
return AF_OK;
}
return AF_UNKNOWN;
@@ -110,6 +218,8 @@
// Deallocate memory
static void uninit(struct af_instance_s* af)
{
+ if(af->setup)
+ free(af->setup);
if(af->data)
free(af->data);
}
@@ -117,32 +227,21 @@
// Filter data through filter
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
- af_data_t* c = data; // Current working data
- af_data_t* l = af->data; // Local data
-
+ af_data_t* c = data; // Current working data
+ af_data_t* l = af->data; // Local data
+ af_channels_t* s = af->setup;
+ int i;
+
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
return NULL;
- // Reset unused channels if nch in < nch out
- if(af->mul.n > af->mul.d)
- memset(l->audio,0,(c->len*af->mul.n)/af->mul.d);
+ // Reset unused channels
+ memset(l->audio,0,(c->len*af->mul.n)/af->mul.d);
- // Special case always output L & R
- if(c->nch == 1){
- copy(c->audio,l->audio,1,0,l->nch,0,c->len,c->bps);
- copy(c->audio,l->audio,1,0,l->nch,1,c->len,c->bps);
- }
- else{
- int i;
- if(l->nch < c->nch){
- for(i=0;i<l->nch;i++) // Truncates R if l->nch == 1 not good need mixing
- copy(c->audio,l->audio,c->nch,i,l->nch,i,c->len,c->bps);
- }
- else{
- for(i=0;i<c->nch;i++)
- copy(c->audio,l->audio,c->nch,i,l->nch,i,c->len,c->bps);
- }
- }
+ if(AF_OK == check_routes(s,c->nch,l->nch))
+ for(i=0;i<s->nr;i++)
+ copy(c->audio,l->audio,c->nch,s->route[i][FR],
+ l->nch,s->route[i][TO],c->len,c->bps);
// Set output data
c->audio = l->audio;
@@ -160,7 +259,8 @@
af->mul.n=1;
af->mul.d=1;
af->data=calloc(1,sizeof(af_data_t));
- if(af->data == NULL)
+ af->setup=calloc(1,sizeof(af_channels_t));
+ if((af->data == NULL) || (af->setup == NULL))
return AF_ERROR;
return AF_OK;
}
Index: af_delay.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_delay.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- af_delay.c 4 Dec 2002 21:48:15 -0000 1.8
+++ af_delay.c 28 Dec 2002 13:59:53 -0000 1.9
@@ -27,14 +27,15 @@
af->data->format = ((af_data_t*)arg)->format;
af->data->bps = ((af_data_t*)arg)->bps;
- return af->control(af,AF_CONTROL_DELAY_SET_LEN,&((af_delay_t*)af->setup)->tlen);
+ return af->control(af,AF_CONTROL_DELAY_LEN | AF_CONTROL_SET,
+ &((af_delay_t*)af->setup)->tlen);
}
case AF_CONTROL_COMMAND_LINE:{
float d = 0;
sscanf((char*)arg,"%f",&d);
- return af->control(af,AF_CONTROL_DELAY_SET_LEN,&d);
+ return af->control(af,AF_CONTROL_DELAY_LEN | AF_CONTROL_SET,&d);
}
- case AF_CONTROL_DELAY_SET_LEN:{
+ case AF_CONTROL_DELAY_LEN | AF_CONTROL_SET:{
af_delay_t* s = (af_delay_t*)af->setup;
void* bt = s->buf; // Old buffer
int lt = s->len; // Old len
@@ -50,8 +51,7 @@
// Set new len and allocate new buffer
s->tlen = *((float*)arg);
af->delay = s->tlen * 1000.0;
-// s->len = af->data->rate*af->data->bps*af->data->nch*(int)s->tlen;
- s->len = ((int)(af->data->rate*s->tlen))*af->data->bps*af->data->nch;
+ s->len = af->data->rate*af->data->bps*af->data->nch*(int)s->tlen;
s->buf = malloc(s->len);
af_msg(AF_MSG_DEBUG0,"[delay] Delaying audio output by %0.2fs\n",s->tlen);
af_msg(AF_MSG_DEBUG1,"[delay] Delaying audio output by %i bytes\n",s->len);
@@ -74,6 +74,9 @@
}
return AF_OK;
}
+ case AF_CONTROL_DELAY_LEN | AF_CONTROL_GET:
+ *((float*)arg) = ((af_delay_t*)af->setup)->tlen;
+ return AF_OK;
}
return AF_UNKNOWN;
}
Index: af_equalizer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_equalizer.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af_equalizer.c 12 Nov 2002 12:33:54 -0000 1.2
+++ af_equalizer.c 28 Dec 2002 13:59:53 -0000 1.3
@@ -22,16 +22,27 @@
#include <math.h>
#include "af.h"
-#include "equalizer.h"
-#define NCH AF_NCH // Number of channels
#define L 2 // Storage for filter taps
#define KM 10 // Max number of bands
#define Q 1.2247449 /* Q value for band-pass filters 1.2247=(3/2)^(1/2)
gives 4dB suppression @ Fc*2 and Fc/2 */
-// Center frequencies for band-pass filters
+/* Center frequencies for band-pass filters
+ The different frequency bands are:
+ nr. center frequency
+ 0 31.25 Hz
+ 1 62.50 Hz
+ 2 125.0 Hz
+ 3 250.0 Hz
+ 4 500.0 Hz
+ 5 1.000 kHz
+ 6 2.000 kHz
+ 7 4.000 kHz
+ 8 8.000 kHz
+ 9 16.00 kHz
+*/
#define CF {31.25,62.5,125,250,500,1000,2000,4000,8000,16000}
// Maximum and minimum gain for the bands
@@ -41,12 +52,12 @@
// Data for specific instances of this filter
typedef struct af_equalizer_s
{
- float a[KM][L]; // A weights
- float b[KM][L]; // B weights
- float wq[NCH][KM][L]; // Circular buffer for W data
- float g[NCH][KM]; // Gain factor for each channel and band
- int K; // Number of used eq bands
- int channels; // Number of channels
+ float a[KM][L]; // A weights
+ float b[KM][L]; // B weights
+ float wq[AF_NCH][KM][L]; // Circular buffer for W data
+ float g[AF_NCH][KM]; // Gain factor for each channel and band
+ int K; // Number of used eq bands
+ int channels; // Number of channels
} af_equalizer_t;
// 2nd order Band-pass Filter design
@@ -76,8 +87,8 @@
af->data->rate = ((af_data_t*)arg)->rate;
af->data->nch = ((af_data_t*)arg)->nch;
- af->data->format = AF_FORMAT_NE | AF_FORMAT_SI;
- af->data->bps = 2;
+ af->data->format = AF_FORMAT_NE | AF_FORMAT_F;
+ af->data->bps = 4;
// Calculate number of active filters
s->K=KM;
@@ -85,7 +96,8 @@
s->K--;
if(s->K != KM)
- af_msg(AF_MSG_INFO,"Limiting the number of filters to %i due to low sample rate.\n",s->K);
+ af_msg(AF_MSG_INFO,"[equalizer] Limiting the number of filters to"
+ " %i due to low sample rate.\n",s->K);
// Generate filter taps
for(k=0;k<s->K;k++)
@@ -94,18 +106,14 @@
// Calculate how much this plugin adds to the overall time delay
af->delay += 2000.0/((float)af->data->rate);
- // Only signed 16 bit little endian is supported
- if(af->data->format != ((af_data_t*)arg)->format ||
- af->data->bps != ((af_data_t*)arg)->bps)
- return AF_FALSE;
- return AF_OK;
+ return af_test_output(af,arg);
}
case AF_CONTROL_COMMAND_LINE:{
float g[10]={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
int i,j;
sscanf((char*)arg,"%f:%f:%f:%f:%f:%f:%f:%f:%f:%f", &g[0], &g[1],
&g[2], &g[3], &g[4], &g[5], &g[6], &g[7], &g[8] ,&g[9]);
- for(i=0;i<NCH;i++){
+ for(i=0;i<AF_NCH;i++){
for(j=0;j<KM;j++){
((af_equalizer_t*)af->setup)->g[i][j] =
pow(10.0,clamp(g[j],G_MIN,G_MAX)/20.0)-1.0;
@@ -113,23 +121,28 @@
}
return AF_OK;
}
- case AF_CONTROL_EQUALIZER_SET_GAIN:{
- float gain = ((equalizer_t*)arg)->gain;
- int ch = ((equalizer_t*)arg)->channel;
- int band = ((equalizer_t*)arg)->band;
- if(ch > NCH || ch < 0 || band > KM || band < 0)
+ case AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET:{
+ float* gain = ((af_control_ext_t*)arg)->arg;
+ int ch = ((af_control_ext_t*)arg)->ch;
+ int k;
+ if(ch > AF_NCH || ch < 0)
return AF_ERROR;
-
- s->g[ch][band] = pow(10.0,clamp(gain,G_MIN,G_MAX)/20.0)-1.0;
+
+ for(k = 0 ; k<KM ; k++)
+ s->g[ch][k] = pow(10.0,clamp(gain[k],G_MIN,G_MAX)/20.0)-1.0;
+
return AF_OK;
}
- case AF_CONTROL_EQUALIZER_GET_GAIN:{
- int ch =((equalizer_t*)arg)->channel;
- int band =((equalizer_t*)arg)->band;
- if(ch > NCH || ch < 0 || band > KM || band < 0)
+ case AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_GET:{
+ float* gain = ((af_control_ext_t*)arg)->arg;
+ int ch = ((af_control_ext_t*)arg)->ch;
+ int k;
+ if(ch > AF_NCH || ch < 0)
return AF_ERROR;
-
- ((equalizer_t*)arg)->gain = log10(s->g[ch][band]+1.0) * 20.0;
+
+ for(k = 0 ; k<KM ; k++)
+ gain[k] = log10(s->g[ch][k]+1.0) * 20.0;
+
return AF_OK;
}
}
@@ -155,13 +168,13 @@
while(ci--){
float* g = s->g[ci]; // Gain factor
- int16_t* in = ((int16_t*)c->audio)+ci;
- int16_t* out = ((int16_t*)c->audio)+ci;
- int16_t* end = in + c->len/2; // Block loop end
+ float* in = ((float*)c->audio)+ci;
+ float* out = ((float*)c->audio)+ci;
+ float* end = in + c->len/4; // Block loop end
while(in < end){
- register uint32_t k = 0; // Frequency band index
- register float yt = (float)(*in); // Current input sample
+ register uint32_t k = 0; // Frequency band index
+ register float yt = *in; // Current input sample
in+=nch;
// Run the filters
@@ -177,7 +190,7 @@
wq[0] = w;
}
// Calculate output
- *out=(int16_t)(yt/(4.0*10.0));
+ *out=yt/(4.0*10.0);
out+=nch;
}
}
Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- af_format.c 14 Nov 2002 09:47:46 -0000 1.9
+++ af_format.c 28 Dec 2002 13:59:53 -0000 1.10
@@ -126,26 +126,32 @@
return str;
}
-// Helper function to check sanity for input arguments
-int check_sanity(af_data_t* data)
+// Helper functions to check sanity for input arguments
+
+// Sanity check for bytes per sample
+int check_bps(int bps)
{
- char buf[256];
- // Sanity check for bytes per sample
- if(data->bps != 4 && data->bps != 2 && data->bps != 1){
- af_msg(AF_MSG_ERROR,"[format] The number of bytes per sample must be 1, 2 or 4. Current value is %i \n",data->bps);
+ if(bps != 4 && bps != 2 && bps != 1){
+ af_msg(AF_MSG_ERROR,"[format] The number of bytes per sample"
+ " must be 1, 2 or 4. Current value is %i \n",bps);
return AF_ERROR;
}
+ return AF_OK;
+}
- // Check for unsupported formats
- switch(data->format & AF_FORMAT_SPECIAL_MASK){
+// Check for unsupported formats
+int check_format(int format)
+{
+ char buf[256];
+ switch(format & AF_FORMAT_SPECIAL_MASK){
case(AF_FORMAT_MPEG2):
case(AF_FORMAT_AC3):
af_msg(AF_MSG_ERROR,"[format] Sample format %s not yet supported \n",
- fmt2str(data->format,buf,255));
+ fmt2str(format,buf,255));
return AF_ERROR;
}
return AF_OK;
-}
+}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
@@ -158,10 +164,12 @@
if(af->data->format == ((af_data_t*)arg)->format &&
af->data->bps == ((af_data_t*)arg)->bps)
return AF_DETACH;
-
+
// Check for errors in configuraton
- if(AF_OK != check_sanity((af_data_t*)arg) ||
- AF_OK != check_sanity(af->data))
+ if((AF_OK != check_bps(((af_data_t*)arg)->bps)) ||
+ (AF_OK != check_format(((af_data_t*)arg)->format)) ||
+ (AF_OK != check_bps(af->data->bps)) ||
+ (AF_OK != check_format(af->data->format)))
return AF_ERROR;
af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %ibit %sto %ibit %s \n",
@@ -175,35 +183,47 @@
return AF_OK;
}
case AF_CONTROL_COMMAND_LINE:{
- af_data_t d={NULL,0,0,0,0,2};
+ int bps = 2;
+ int format = AF_FORMAT_NE;
char str[256];
str[0] = '\0';
- sscanf((char*)arg,"%i:%s",&(d.bps),str);
+ sscanf((char*)arg,"%i:%s",&bps,str);
// Convert string to format
- d.format = str2fmt(str);
+ format = str2fmt(str);
// Automatic correction of errors
- switch(d.format & AF_FORMAT_SPECIAL_MASK){
+ switch(format & AF_FORMAT_SPECIAL_MASK){
case(AF_FORMAT_A_LAW):
case(AF_FORMAT_MU_LAW):
- d.bps=1; break;
+ bps=1; break;
case(AF_FORMAT_AC3):
- d.bps=4; break; // I think
+ bps=4; break; // I think
}
- if(AF_FORMAT_F == (d.format & AF_FORMAT_POINT_MASK))
- d.bps=4;
-
- return af->control(af,AF_CONTROL_FORMAT,&d);
+ if(AF_FORMAT_F == (format & AF_FORMAT_POINT_MASK))
+ bps=4;
+
+ if((AF_OK != af->control(af,AF_CONTROL_FORMAT_BPS | AF_CONTROL_SET,&bps)) ||
+ (AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET,&format)))
+ return AF_ERROR;
+ return AF_OK;
}
- case AF_CONTROL_FORMAT:
+ case AF_CONTROL_FORMAT_BPS | AF_CONTROL_SET:
// Reinit must be called after this function has been called
// Check for errors in configuraton
- if(AF_OK != check_sanity((af_data_t*)arg))
+ if(AF_OK != check_bps(*(int*)arg))
+ return AF_ERROR;
+
+ af->data->bps = *(int*)arg;
+ return AF_OK;
+ case AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET:
+ // Reinit must be called after this function has been called
+
+ // Check for errors in configuraton
+ if(AF_OK != check_format(*(int*)arg))
return AF_ERROR;
- af->data->format = ((af_data_t*)arg)->format;
- af->data->bps=((af_data_t*)arg)->bps;
+ af->data->format = *(int*)arg;
return AF_OK;
}
return AF_UNKNOWN;
Index: af_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_resample.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- af_resample.c 14 Dec 2002 17:55:38 -0000 1.15
+++ af_resample.c 28 Dec 2002 13:59:53 -0000 1.16
@@ -25,45 +25,36 @@
slow and to 16 if the machine is fast and has MMX.
*/
-#if !defined(HAVE_SSE) && !defined(HAVE_3DNOW) // This machine is slow
-
-#define L 8 // Filter length
-// Unrolled loop to speed up execution
-#define FIR(x,w,y) \
- (y[0]) = ( w[0]*x[0]+w[1]*x[1]+w[2]*x[2]+w[3]*x[3] \
- + w[4]*x[4]+w[5]*x[5]+w[6]*x[6]+w[7]*x[7] ) >> 16
-
-#else /* Fast machine */
-
-#define L 16
-// Unrolled loop to speed up execution
-#define FIR(x,w,y) \
- y[0] = ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] \
- + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] \
- + w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] \
- + w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ) >> 16
-
-#endif /* Fast machine */
-
-// Macro to add data to circular que
-#define ADDQUE(xi,xq,in)\
- xq[xi]=xq[xi+L]=(*in);\
- xi=(xi-1)&(L-1);
-
+#if !defined(HAVE_MMX) // This machine is slow
+#define L8
+#else
+#define L16
+#endif
+
+#include "af_resample.h"
+
+// Filtering types
+#define TYPE_LIN 0 // Linear interpolation
+#define TYPE_INT 1 // 16 bit integer
+#define TYPE_FLOAT 2 // 32 bit floating point
+// Accuracy for linear interpolation
+#define STEPACCURACY 32
// local data
typedef struct af_resample_s
{
- int16_t* w; // Current filter weights
- int16_t** xq; // Circular buffers
+ void* w; // Current filter weights
+ void** xq; // Circular buffers
uint32_t xi; // Index for circular buffers
uint32_t wi; // Index for w
- uint32_t i; // Number of new samples to put in x queue
+ uint32_t i; // Number of new samples to put in x queue
uint32_t dn; // Down sampling factor
uint32_t up; // Up sampling factor
+ uint64_t step; // Step size for linear interpolation
+ uint64_t pt; // Pointer remainder for linear interpolation
int sloppy; // Enable sloppy resampling to reduce memory usage
- int fast; // Enable linear interpolation instead of filtering
+ int type; // Filter type
} af_resample_t;
// Euclids algorithm for calculating Greatest Common Divisor GCD(a,b)
@@ -82,96 +73,50 @@
return b;
}
-static int upsample(af_data_t* c,af_data_t* l, af_resample_t* s)
-{
- uint32_t ci = l->nch; // Index for channels
- uint32_t len = 0; // Number of input samples
- uint32_t nch = l->nch; // Number of channels
- uint32_t inc = s->up/s->dn;
- uint32_t level = s->up%s->dn;
- uint32_t up = s->up;
- uint32_t dn = s->dn;
-
- register int16_t* w = s->w;
- register uint32_t wi = 0;
- register uint32_t xi = 0;
-
- // Index current channel
- while(ci--){
- // Temporary pointers
- register int16_t* x = s->xq[ci];
- register int16_t* in = ((int16_t*)c->audio)+ci;
- register int16_t* out = ((int16_t*)l->audio)+ci;
- int16_t* end = in+c->len/2; // Block loop end
- wi = s->wi; xi = s->xi;
-
- while(in < end){
- register uint32_t i = inc;
- if(wi<level) i++;
-
- ADDQUE(xi,x,in);
- in+=nch;
- while(i--){
- // Run the FIR filter
- FIR((&x[xi]),(&w[wi*L]),out);
- len++; out+=nch;
- // Update wi to point at the correct polyphase component
- wi=(wi+dn)%up;
- }
- }
- }
- // Save values that needs to be kept for next time
- s->wi = wi;
- s->xi = xi;
- return len;
-}
-
-static int downsample(af_data_t* c,af_data_t* l, af_resample_t* s)
+// Fast linear interpolation resample with modest audio quality
+static int linint(af_data_t* c,af_data_t* l, af_resample_t* s)
{
- uint32_t ci = l->nch; // Index for channels
- uint32_t len = 0; // Number of output samples
- uint32_t nch = l->nch; // Number of channels
- uint32_t inc = s->dn/s->up;
- uint32_t level = s->dn%s->up;
- uint32_t up = s->up;
- uint32_t dn = s->dn;
-
- register int32_t i = 0;
- register uint32_t wi = 0;
- register uint32_t xi = 0;
+ uint32_t len = 0; // Number of input samples
+ uint32_t nch = l->nch; // Words pre transfer
+ uint64_t step = s->step;
+ int16_t* in16 = ((int16_t*)c->audio);
+ int16_t* out16 = ((int16_t*)l->audio);
+ int32_t* in32 = ((int32_t*)c->audio);
+ int32_t* out32 = ((int32_t*)l->audio);
+ uint64_t end = ((((uint64_t)c->len)/2LL)<<STEPACCURACY);
+ uint64_t pt = s->pt;
+ uint16_t tmp;
- // Index current channel
- while(ci--){
- // Temporary pointers
- register int16_t* x = s->xq[ci];
- register int16_t* in = ((int16_t*)c->audio)+ci;
- register int16_t* out = ((int16_t*)l->audio)+ci;
- register int16_t* end = in+c->len/2; // Block loop end
- i = s->i; wi = s->wi; xi = s->xi;
-
- while(in < end){
-
- ADDQUE(xi,x,in);
- in+=nch;
- if((--i)<=0){
- // Run the FIR filter
- FIR((&x[xi]),(&s->w[wi*L]),out);
- len++; out+=nch;
-
- // Update wi to point at the correct polyphase component
- wi=(wi+dn)%up;
-
- // Insert i number of new samples in queue
- i = inc;
- if(wi<level) i++;
- }
+ switch (nch){
+ case 1:
+ while(pt < end){
+ out16[len++]=in16[pt>>STEPACCURACY];
+ pt+=step;
+ }
+ s->pt=pt & ((1LL<<STEPACCURACY)-1);
+ break;
+ case 2:
+ end/=2;
+ while(pt < end){
+ out32[len++]=in32[pt>>STEPACCURACY];
+ pt+=step;
}
+ len=(len<<1);
+ s->pt=pt & ((1LL<<STEPACCURACY)-1);
+ break;
+ default:
+ end /=nch;
+ while(pt < end){
+ tmp=nch;
+ do {
+ tmp--;
+ out16[len+tmp]=in16[tmp+(pt>>STEPACCURACY)*nch];
+ } while (tmp);
+ len+=nch;
+ pt+=step;
+ }
+ s->pt=pt & ((1LL<<STEPACCURACY)-1);
}
- // Save values that needs to be kept for next time
- s->wi = wi;
- s->xi = xi;
- s->i = i;
-
return len;
}
@@ -184,13 +129,24 @@
af_data_t* n = (af_data_t*)arg; // New configureation
int i,d = 0;
int rv = AF_OK;
+ size_t tsz = (s->type==TYPE_INT) ? sizeof(int16_t) : sizeof(float);
// Make sure this filter isn't redundant
if(af->data->rate == n->rate)
return AF_DETACH;
+ // If linear interpolation
+ if(s->type == TYPE_LIN){
+ s->pt=0LL;
+ s->step=((uint64_t)n->rate<<STEPACCURACY)/(uint64_t)af->data->rate+1LL;
+ af_msg(AF_MSG_VERBOSE,"[resample] Linear interpolation step: 0x%016X.\n",
+ s->step);
+ af->mul.n = af->data->rate;
+ af->mul.d = n->rate;
+ }
+
// Create space for circular bufers (if nesessary)
- if(af->data->nch != n->nch){
+ if((af->data->nch != n->nch) && (s->type != TYPE_LIN)){
// First free the old ones
if(s->xq){
for(i=1;i<af->data->nch;i++)
@@ -199,20 +155,30 @@
free(s->xq);
}
// ... then create new
- s->xq = malloc(n->nch*sizeof(int16_t*));
+ s->xq = malloc(n->nch*sizeof(void*));
for(i=0;i<n->nch;i++)
- s->xq[i] = malloc(2*L*sizeof(int16_t));
+ s->xq[i] = malloc(2*L*tsz);
s->xi = 0;
}
// Set parameters
af->data->nch = n->nch;
- af->data->format = AF_FORMAT_NE | AF_FORMAT_SI;
- af->data->bps = 2;
+ if(s->type == TYPE_INT || s->type == TYPE_LIN){
+ af->data->format = AF_FORMAT_NE | AF_FORMAT_SI;
+ af->data->bps = 2;
+ }
+ else{
+ af->data->format = AF_FORMAT_NE | AF_FORMAT_F;
+ af->data->bps = 4;
+ }
if(af->data->format != n->format || af->data->bps != n->bps)
rv = AF_FALSE;
- n->format = AF_FORMAT_NE | AF_FORMAT_SI;
- n->bps = 2;
+ n->format = af->data->format;
+ n->bps = af->data->bps;
+
+ // If linear interpolation is used the setup is done.
+ if(s->type == TYPE_LIN)
+ return rv;
// Calculate up and down sampling factors
d=gcd(af->data->rate,n->rate);
@@ -244,7 +210,7 @@
w = malloc(sizeof(float) * s->up *L);
if(NULL != s->w)
free(s->w);
- s->w = malloc(L*s->up*sizeof(int16_t));
+ s->w = malloc(L*s->up*tsz);
// Design prototype filter type using Kaiser window with beta = 10
if(NULL == w || NULL == s->w ||
@@ -256,13 +222,18 @@
wt=w;
for(j=0;j<L;j++){//Columns
for(i=0;i<s->up;i++){//Rows
- float t=(float)s->up*32767.0*(*wt);
- s->w[i*L+j] = (int16_t)((t>=0.0)?(t+0.5):(t-0.5));
+ if(s->type == TYPE_INT){
+ float t=(float)s->up*32767.0*(*wt);
+ ((int16_t*)s->w)[i*L+j] = (int16_t)((t>=0.0)?(t+0.5):(t-0.5));
+ }
+ else
+ ((float*)s->w)[i*L+j] = (float)s->up*(*wt);
wt++;
}
}
free(w);
- af_msg(AF_MSG_VERBOSE,"[resample] New filter designed up: %i down: %i\n", s->up, s->dn);
+ af_msg(AF_MSG_VERBOSE,"[resample] New filter designed up: %i "
+ "down: %i\n", s->up, s->dn);
}
// Set multiplier and delay
@@ -274,20 +245,30 @@
case AF_CONTROL_COMMAND_LINE:{
af_resample_t* s = (af_resample_t*)af->setup;
int rate=0;
- sscanf((char*)arg,"%i:%i:%i",&rate,&(s->sloppy), &(s->fast));
- return af->control(af,AF_CONTROL_RESAMPLE,&rate);
+ int lin=0;
+ sscanf((char*)arg,"%i:%i:%i", &rate, &(s->sloppy), &lin);
+ if(lin)
+ s->type = TYPE_LIN;
+ return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate);
}
- case AF_CONTROL_RESAMPLE:
+ case AF_CONTROL_POST_CREATE:
+ ((af_resample_t*)af->setup)->type =
+ ((af_cfg_t*)arg)->force == AF_INIT_SLOW ? TYPE_INT : TYPE_FLOAT;
+ return AF_OK;
+ case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET:
// Reinit must be called after this function has been called
// Sanity check
if(((int*)arg)[0] < 8000 || ((int*)arg)[0] > 192000){
- af_msg(AF_MSG_ERROR,"[resample] The output sample frequency must be between 8kHz and 192kHz. Current value is %i \n",((int*)arg)[0]);
+ af_msg(AF_MSG_ERROR,"[resample] The output sample frequency "
+ "must be between 8kHz and 192kHz. Current value is %i \n",
+ ((int*)arg)[0]);
return AF_ERROR;
}
af->data->rate=((int*)arg)[0];
- af_msg(AF_MSG_VERBOSE,"[resample] Changing sample rate to %iHz\n",af->data->rate);
+ af_msg(AF_MSG_VERBOSE,"[resample] Changing sample rate "
+ "to %iHz\n",af->data->rate);
return AF_OK;
}
return AF_UNKNOWN;
@@ -312,14 +293,42 @@
return NULL;
// Run resampling
- if(s->up>s->dn)
- len = upsample(c,l,s);
- else
- len = downsample(c,l,s);
+ switch(s->type){
+ case(TYPE_INT):
+# define FORMAT_I 1
+ if(s->up>s->dn){
+# define UP
+# include "af_resample.h"
+# undef UP
+ }
+ else{
+# define DN
+# include "af_resample.h"
+# undef DN
+ }
+ break;
+ case(TYPE_FLOAT):
+# undef FORMAT_I
+# define FORMAT_F 1
+ if(s->up>s->dn){
+# define UP
+# include "af_resample.h"
+# undef UP
+ }
+ else{
+# define DN
+# include "af_resample.h"
+# undef DN
+ }
+ break;
+ case(TYPE_LIN):
+ len = linint(c, l, s);
+ break;
+ }
// Set output data
c->audio = l->audio;
- c->len = len*2;
+ c->len = len*l->bps;
c->rate = l->rate;
return c;
Index: af_volume.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_volume.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- af_volume.c 14 Nov 2002 09:49:06 -0000 1.5
+++ af_volume.c 28 Dec 2002 13:59:53 -0000 1.6
@@ -1,19 +1,27 @@
+/*=============================================================================
+//
+// This software has been released under the terms of the GNU Public
+// license. See http://www.gnu.org/copyleft/gpl.html for details.
+//
+// Copyright 2002 Anders Johansson ajh(a)atri.curtin.edu.au
+//
+//=============================================================================
+*/
+
/* This audio filter changes the volume of the sound, and can be used
- when the mixer doesn't support the PCM channel. It can handel
+ when the mixer doesn't support the PCM channel. It can handle
between 1 and 6 channels. The volume can be adjusted between -60dB
- to +20dB and is set on a per channels basis. The volume can be
- written ad read by AF_CONTROL_VOLUME_SET and AF_CONTROL_VOLUME_GET
- respectivly.
+ to +20dB and is set on a per channels basis. The is accessed through
+ AF_CONTROL_VOLUME_LEVEL.
- The plugin has support for softclipping, it is enabled by
+ The filter has support for soft-clipping, it is enabled by
AF_CONTROL_VOLUME_SOFTCLIPP. It has also a probing feature which
can be used to measure the power in the audio stream, both an
- instantanious value and the maximum value can be probed. The
+ instantaneous value and the maximum value can be probed. The
probing is enable by AF_CONTROL_VOLUME_PROBE_ON_OFF and is done on a
per channel basis. The result from the probing is obtained using
AF_CONTROL_VOLUME_PROBE_GET and AF_CONTROL_VOLUME_PROBE_GET_MAX. The
- probed values are calculated in dB. The control of the volume can
- be turned off by the AF_CONTROL_VOLUME_ON_OFF switch.
+ probed values are calculated in dB.
*/
#include <stdio.h>
@@ -22,66 +30,22 @@
#include <unistd.h>
#include <inttypes.h>
#include <math.h>
+#include <limits.h>
#include "af.h"
-// Some limits
-#define NCH AF_NCH // Number of channels
-
-#define MIN_S16 -32650
-#define MAX_S16 32650
-
-#define MAX_VOL +40.0
-#define MIN_VOL -200.0
-
// Data for specific instances of this filter
typedef struct af_volume_s
{
- float volume[NCH]; // Volume for each channel
- float power[NCH]; // Instantaneous power in each channel
- float maxpower[NCH]; // Maximum power in each channel
- float alpha; // Forgetting factor for power estimate
- int softclip; // Soft clippng on/off
- int probe; // Probing on/off
- int onoff; // Volume control on/off
+ int enable[AF_NCH]; // Enable/disable / channel
+ float pow[AF_NCH]; // Estimated power level [dB]
+ float max[AF_NCH]; // Max Power level [dB]
+ float level[AF_NCH]; // Gain level for each channel
+ float time; // Forgetting factor for power estimate
+ int soft; // Enable/disable soft clipping
+ int fast; // Use fix-point volume control
}af_volume_t;
-/* Convert to gain value from dB. Returns AF_OK if of and AF_ERROR if
- fail */
-inline int from_dB(float* in, float* out, float k)
-{
- int i = 0;
- // Sanity check
- if(!in || !out)
- return AF_ERROR;
-
- for(i=0;i<NCH;i++){
- if(in[i]<MIN_VOL)
- out[i]=0.0;
- else
- out[i]=pow(10.0,clamp(in[i],MIN_VOL,MAX_VOL)/k);
- }
- return AF_OK;
-}
-
-/* Convert from gain value to dB. Returns AF_OK if of and AF_ERROR if
- fail */
-inline int to_dB(float* in, float* out, float k)
-{
- int i = 0;
- // Sanity check
- if(!in || !out)
- return AF_ERROR;
-
- for(i=0;i<NCH;i++){
- if(in[i] == 0.0)
- out[i]=MIN_VOL;
- else
- out[i]=k*log10(clamp(in[i],MIN_VOL,MAX_VOL));
- }
- return AF_OK;
-}
-
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
@@ -94,48 +58,57 @@
af->data->rate = ((af_data_t*)arg)->rate;
af->data->nch = ((af_data_t*)arg)->nch;
- af->data->format = AF_FORMAT_SI | AF_FORMAT_LE;
- af->data->bps = 2;
- // Time constant set to 0.1s
- s->alpha = (1.0/0.2)/(2.0*M_PI*(float)((af_data_t*)arg)->rate);
-
- // Only AFMT_S16_LE is supported for now
- if(af->data->format != ((af_data_t*)arg)->format ||
- af->data->bps != ((af_data_t*)arg)->bps)
- return AF_FALSE;
- return AF_OK;
+ if(s->fast){
+ af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+ af->data->bps = 2;
+ }
+ else{
+ // Cutoff set to 10Hz for forgetting factor
+ float x = 2.0*M_PI*15.0/(float)af->data->rate;
+ float t = 2.0-cos(x);
+ s->time = 1.0 - (t - sqrt(t*t - 1));
+ af_msg(AF_MSG_DEBUG0,"[volume] Forgetting factor = %0.5f\n",s->time);
+ af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+ af->data->bps = 4;
+ }
+ return af_test_output(af,(af_data_t*)arg);
case AF_CONTROL_COMMAND_LINE:{
float v=-10.0;
- float vol[6];
- int i;
- sscanf((char*)arg,"%f:%i:%i:%i", &v,
- &(s->softclip), &(s->probe), &(s->onoff));
- for(i=0;i<NCH;i++) vol[i]=v;
- return from_dB(vol,s->volume,20.0);
- }
- case AF_CONTROL_VOLUME_SET:
- return from_dB((float*)arg,s->volume,20.0);
- case AF_CONTROL_VOLUME_GET:
- return to_dB(s->volume,(float*)arg,20.0);
- case AF_CONTROL_VOLUME_PROBE_GET:
- return to_dB(s->power,(float*)arg,10.0);
- case AF_CONTROL_VOLUME_PROBE_GET_MAX:
- return to_dB(s->maxpower,(float*)arg,10.0);
- case AF_CONTROL_VOLUME_SOFTCLIP:
- s->softclip = (int)arg;
- return AF_OK;
- case AF_CONTROL_VOLUME_PROBE_ON_OFF:
- s->probe = (int)arg;
- return AF_OK;
- case AF_CONTROL_VOLUME_ON_OFF:
- s->onoff = (int)arg;
+ float vol[AF_NCH];
+ int i;
+ sscanf((char*)arg,"%f:%i", &v, &s->soft);
+ for(i=0;i<AF_NCH;i++) vol[i]=v;
+ return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol);
+ }
+ case AF_CONTROL_POST_CREATE:
+ s->fast = ((af_cfg_t*)arg)->force == AF_INIT_SLOW ? 1 : 0;
return AF_OK;
+ case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_SET:
+ memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int));
+ return AF_OK;
+ case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_GET:
+ memcpy((int*)arg,s->enable,AF_NCH*sizeof(int));
+ return AF_OK;
+ case AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_SET:
+ s->soft = *(int*)arg;
+ return AF_OK;
+ case AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_GET:
+ *(int*)arg = s->soft;
+ return AF_OK;
+ case AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET:
+ return af_from_dB(AF_NCH,(float*)arg,s->level,20.0,-200.0,60.0);
+ case AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_GET:
+ return af_to_dB(AF_NCH,s->level,(float*)arg,20.0);
+ case AF_CONTROL_VOLUME_PROBE | AF_CONTROL_GET:
+ return af_to_dB(AF_NCH,s->pow,(float*)arg,10.0);
+ case AF_CONTROL_VOLUME_PROBE_MAX | AF_CONTROL_GET:
+ return af_to_dB(AF_NCH,s->max,(float*)arg,10.0);
case AF_CONTROL_PRE_DESTROY:{
float m = 0.0;
int i;
- for(i=0;i<NCH;i++)
- m=max(m,s->maxpower[i]);
+ for(i=0;i<AF_NCH;i++)
+ m=max(m,s->max[i]);
af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m));
return AF_OK;
}
@@ -155,57 +128,66 @@
// Filter data through filter
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
- af_data_t* c = data; // Current working data
- af_volume_t* s = (af_volume_t*)af->setup; // Setup for this instance
- int16_t* a = (int16_t*)c->audio; // Audio data
- int len = c->len/2; // Number of samples
- int ch = 0; // Channel counter
- register int nch = c->nch; // Number of channels
- register int i = 0;
-
- // Probe the data stream
- if(s->probe){
+ af_data_t* c = data; // Current working data
+ af_volume_t* s = (af_volume_t*)af->setup; // Setup for this instance
+ int ch = 0; // Channel counter
+ register int nch = c->nch; // Number of channels
+ register int i = 0;
+
+ // Basic operation volume control only (used on slow machines)
+ if(af->data->format == (AF_FORMAT_SI | AF_FORMAT_NE)){
+ int16_t* a = (int16_t*)c->audio; // Audio data
+ int len = c->len/2; // Number of samples
for(ch = 0; ch < nch ; ch++){
- float alpha = s->alpha;
- float beta = 1 - alpha;
- float pow = s->power[ch];
- float maxpow = s->maxpower[ch];
- register float t = 0;
- for(i=ch;i<len;i+=nch){
- t = ((float)a[i])/32768.0;
- t *= t;
- // Check maximum power value
- if(t>maxpow)
- maxpow=t;
- // Power estimate made using first order AR model
- if(t>pow)
- pow=t;
- else
- pow = beta*pow+alpha*t;
+ if(s->enable[ch]){
+ register int vol = (int)(255.0 * s->level[ch]);
+ for(i=ch;i<len;i+=nch){
+ register int x = (a[i] * vol) >> 8;
+ a[i]=clamp(x,SHRT_MIN,SHRT_MAX);
+ }
}
- s->power[ch] = pow;
- s->maxpower[ch] = maxpow;
}
}
-
- // Change the volume.
- if(s->onoff){
- register int sc = s->softclip;
+ // Machine is fast and data is floating point
+ else if(af->data->format == (AF_FORMAT_F | AF_FORMAT_NE)){
+ float* a = (float*)c->audio; // Audio data
+ int len = c->len/4; // Number of samples
for(ch = 0; ch < nch ; ch++){
- register int vol = (int)(255.0 * s->volume[ch]);
- for(i=ch;i<len;i+=nch){
- register int x;
- x=(a[i] * vol) >> 8;
- if(sc){
- int64_t t=x*x;
- t=(t*x) >> 30;
- x = (3*x - (int)t) >> 1;
+ // Volume control (fader)
+ if(s->enable[ch]){
+ float t = 1.0 - s->time;
+ for(i=ch;i<len;i+=nch){
+ register float x = a[i];
+ register float pow = x*x;
+ // Check maximum power value
+ if(pow > s->max[ch])
+ s->max[ch] = pow;
+ // Set volume
+ x *= s->level[ch];
+ // Peak meter
+ pow = x*x;
+ if(pow > s->pow[ch])
+ s->pow[ch] = pow;
+ else
+ s->pow[ch] = t*s->pow[ch] + pow*s->time; // LP filter
+ /* Soft clipping, the sound of a dream, thanks to Jon Wattes
+ post to Musicdsp.org */
+ if(s->soft){
+ if (x >= M_PI/2)
+ x = 1.0;
+ else if(x <= -M_PI/2)
+ x = -1.0;
+ else
+ x = sin(x);
+ }
+ // Hard clipping
+ else
+ x=clamp(x,-1.0,1.0);
+ a[i] = x;
}
- a[i]=clamp(x,MIN_S16,MAX_S16);
}
}
}
-
return c;
}
@@ -222,13 +204,13 @@
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
/* Enable volume control and set initial volume to 0.1 this is a
- safety mesure to ensure that the user doesn't blow his
+ safety measure to ensure that the user doesn't blow his
speakers. If the user isn't happy with this he can use the
- commandline parameters to set the initial volume */
- ((af_volume_t*)af->setup)->onoff = 1;
- for(i=0;i<NCH;i++)
- ((af_volume_t*)af->setup)->volume[i]=0.1;
-
+ command-line parameters to set the initial volume */
+ for(i=0;i<AF_NCH;i++){
+ ((af_volume_t*)af->setup)->enable[i] = 1;
+ ((af_volume_t*)af->setup)->level[i] = 0.1;
+ }
return AF_OK;
}
Index: control.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/control.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- control.h 3 Nov 2002 09:51:02 -0000 1.3
+++ control.h 28 Dec 2002 13:59:53 -0000 1.4
@@ -2,6 +2,57 @@
#define __af_control_h
/*********************************************
+// Control info struct.
+//
+// This struct is the argument in a info call to a filter.
+*/
+
+// Argument types
+#define AF_CONTROL_TYPE_BOOL (0x0<<0)
+#define AF_CONTROL_TYPE_CHAR (0x1<<0)
+#define AF_CONTROL_TYPE_INT (0x2<<0)
+#define AF_CONTROL_TYPE_FLOAT (0x3<<0)
+#define AF_CONTROL_TYPE_STRUCT (0x4<<0)
+#define AF_CONTROL_TYPE_SPECIAL (0x5<<0) // a pointer to a function for example
+#define AF_CONTROL_TYPE_MASK (0x7<<0)
+// Argument geometry
+#define AF_CONTROL_GEOM_SCALAR (0x0<<3)
+#define AF_CONTROL_GEOM_ARRAY (0x1<<3)
+#define AF_CONTROL_GEOM_MATRIX (0x2<<3)
+#define AF_CONTROL_GEOM_MASK (0x3<<3)
+// Argument properties
+#define AF_CONTROL_PROP_READ (0x0<<5) // The argument can be read
+#define AF_CONTROL_PROP_WRITE (0x1<<5) // The argument can be written
+#define AF_CONTROL_PROP_SAVE (0x2<<5) // Can be saved
+#define AF_CONTROL_PROP_RUNTIME (0x4<<5) // Acessable during execution
+#define AF_CONTROL_PROP_CHANNEL (0x8<<5) // Argument is set per channel
+#define AF_CONTROL_PROP_MASK (0xF<<5)
+
+typedef struct af_control_info_s{
+ int def; // Control enumrification
+ char* name; // Name of argument
+ char* info; // Description of what it does
+ int flags; // Flags as defined above
+ float max; // Max and min value
+ float min; // (only aplicable on float and int)
+ int xdim; // 1st dimension
+ int ydim; // 2nd dimension (=0 for everything except matrix)
+ size_t sz; // Size of argument in bytes
+ int ch; // Channel number (for future use)
+ void* arg; // Data (for future use)
+}af_control_info_t;
+
+
+/*********************************************
+// Extended control used with arguments that operates on only one
+// channel at the time
+*/
+typedef struct af_control_ext_s{
+ void* arg; // Argument
+ int ch; // Chanel number
+}af_control_ext_t;
+
+/*********************************************
// Control parameters
*/
@@ -11,9 +62,9 @@
filter specific calls - applies only to some filters
*/
-#define AF_CONTROL_MANDATORY_BASE 0
-#define AF_CONTROL_OPTIONAL_BASE 100
-#define AF_CONTROL_FILTER_SPECIFIC_BASE 200
+#define AF_CONTROL_MANDATORY 0x10000000
+#define AF_CONTROL_OPTIONAL 0x20000000
+#define AF_CONTROL_FILTER_SPECIFIC 0x40000000
// MANDATORY CALLS
@@ -23,66 +74,136 @@
should be returned. If the incoming and outgoing data streams are
identical the filter can return AF_DETACH. This will remove the
filter. */
-#define AF_CONTROL_REINIT 01 + AF_CONTROL_MANDATORY_BASE
+#define AF_CONTROL_REINIT 0x00000100 | AF_CONTROL_MANDATORY
// OPTIONAL CALLS
/* Called just after creation with the af_cfg for the stream in which
the filter resides as input parameter this call can be used by the
filter to initialize itself */
-#define AF_CONTROL_POST_CREATE 1 + AF_CONTROL_OPTIONAL_BASE
+#define AF_CONTROL_POST_CREATE 0x00000100 | AF_CONTROL_OPTIONAL
// Called just before destruction of a filter
-#define AF_CONTROL_PRE_DESTROY 2 + AF_CONTROL_OPTIONAL_BASE
+#define AF_CONTROL_PRE_DESTROY 0x00000200 | AF_CONTROL_OPTIONAL
/* Commandline parameters. If there were any commandline parameters
for this specific filter, they will be given as a char* in the
argument */
-#define AF_CONTROL_COMMAND_LINE 3 + AF_CONTROL_OPTIONAL_BASE
+#define AF_CONTROL_COMMAND_LINE 0x00000300 | AF_CONTROL_OPTIONAL
// FILTER SPECIFIC CALLS
+// Basic operations: These can be ored with any of the below calls
+// Set argument
+#define AF_CONTROL_SET 0x00000000
+// Get argument
+#define AF_CONTROL_GET 0x00000001
+// Get info about the control, i.e fill in everything except argument
+#define AF_CONTROL_INFO 0x00000002
+
+// Resample
+
// Set output rate in resample
-#define AF_CONTROL_RESAMPLE 1 + AF_CONTROL_FILTER_SPECIFIC_BASE
+#define AF_CONTROL_RESAMPLE_RATE 0x00000100 | AF_CONTROL_FILTER_SPECIFIC
+
+// Enable sloppy resampling
+#define AF_CONTROL_RESAMPLE_SLOPPY 0x00000200 | AF_CONTROL_FILTER_SPECIFIC
+
+// Set resampling accuracy
+#define AF_CONTROL_RESAMPLE_ACCURACY 0x00000300 | AF_CONTROL_FILTER_SPECIFIC
-// Set output format in format
-#define AF_CONTROL_FORMAT 2 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Format
+
+// Set output format bits per sample
+#define AF_CONTROL_FORMAT_BPS 0x00000400 | AF_CONTROL_FILTER_SPECIFIC
+
+// Set output format sample format
+#define AF_CONTROL_FORMAT_FMT 0x00000500 | AF_CONTROL_FILTER_SPECIFIC
+
+// Channels
// Set number of output channels in channels
-#define AF_CONTROL_CHANNELS 3 + AF_CONTROL_FILTER_SPECIFIC_BASE
+#define AF_CONTROL_CHANNELS 0x00000600 | AF_CONTROL_FILTER_SPECIFIC
+
+// Set number of channel routes
+#define AF_CONTROL_CHANNELS_ROUTES 0x00000700 | AF_CONTROL_FILTER_SPECIFIC
-// Set delay length in delay
-#define AF_CONTROL_DELAY_SET_LEN 4 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Set channel routing pair, arg is int[2] and ch is used
+#define AF_CONTROL_CHANNELS_ROUTING 0x00000800 | AF_CONTROL_FILTER_SPECIFIC
+// Set nuber of channel routing pairs, arg is int*
+#define AF_CONTROL_CHANNELS_NR 0x00000900 | AF_CONTROL_FILTER_SPECIFIC
+
+// Set make af_channels into a router
+#define AF_CONTROL_CHANNELS_ROUTER 0x00000A00 | AF_CONTROL_FILTER_SPECIFIC
+
// Volume
+// Turn volume control on and off, arg is int*
+#define AF_CONTROL_VOLUME_ON_OFF 0x00000B00 | AF_CONTROL_FILTER_SPECIFIC
+
+// Turn soft clipping of the volume on and off, arg is binary
+#define AF_CONTROL_VOLUME_SOFTCLIP 0x00000C00 | AF_CONTROL_FILTER_SPECIFIC
+
// Set volume level, arg is a float* with the volume for all the channels
-#define AF_CONTROL_VOLUME_SET 5 + AF_CONTROL_FILTER_SPECIFIC_BASE
+#define AF_CONTROL_VOLUME_LEVEL 0x00000D00 | AF_CONTROL_FILTER_SPECIFIC
-/* Get volume level for all channels, arg is a float* that will
- contain the volume for all the channels */
-#define AF_CONTROL_VOLUME_GET 6 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Probed power level for all channels, arg is a float*
+#define AF_CONTROL_VOLUME_PROBE 0x00000E00 | AF_CONTROL_FILTER_SPECIFIC
-// Turn volume control on and off, arg is binary
-#define AF_CONTROL_VOLUME_ON_OFF 7 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Maximum probed power level for all channels, arg is a float*
+#define AF_CONTROL_VOLUME_PROBE_MAX 0x00000F00 | AF_CONTROL_FILTER_SPECIFIC
-// Turn soft clipping of the volume on and off, arg is binary
-#define AF_CONTROL_VOLUME_SOFTCLIP 8 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Compressor/expander
+
+// Turn compressor/expander on and off
+#define AF_CONTROL_COMP_ON_OFF 0x00001000 | AF_CONTROL_FILTER_SPECIFIC
+
+// Compression/expansion threshold [dB]
+#define AF_CONTROL_COMP_THRESH 0x00001100 | AF_CONTROL_FILTER_SPECIFIC
+
+// Compression/expansion attack time [ms]
+#define AF_CONTROL_COMP_ATTACK 0x00001200 | AF_CONTROL_FILTER_SPECIFIC
+
+// Compression/expansion release time [ms]
+#define AF_CONTROL_COMP_RELEASE 0x00001300 | AF_CONTROL_FILTER_SPECIFIC
+
+// Compression/expansion gain level [dB]
+#define AF_CONTROL_COMP_RATIO 0x00001400 | AF_CONTROL_FILTER_SPECIFIC
+
+// Noise gate
+
+// Turn noise gate on an off
+#define AF_CONTROL_GATE_ON_OFF 0x00001500 | AF_CONTROL_FILTER_SPECIFIC
+
+// Noise gate threshold [dB]
+#define AF_CONTROL_GATE_THRESH 0x00001600 | AF_CONTROL_FILTER_SPECIFIC
+
+// Noise gate attack time [ms]
+#define AF_CONTROL_GATE_ATTACK 0x00001700 | AF_CONTROL_FILTER_SPECIFIC
+
+// Noise gate release time [ms]
+#define AF_CONTROL_GATE_RELEASE 0x00001800 | AF_CONTROL_FILTER_SPECIFIC
+
+// Noise gate release range level [dB]
+#define AF_CONTROL_GATE_RANGE 0x00001900 | AF_CONTROL_FILTER_SPECIFIC
+
+// Pan
+
+// Pan levels, arg is a control_ext with a float*
+#define AF_CONTROL_PAN_LEVEL 0x00001A00 | AF_CONTROL_FILTER_SPECIFIC
-// Get the probed power level for all channels, arg is a float*
-#define AF_CONTROL_VOLUME_PROBE_GET 9 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Number of outputs from pan, arg is int*
+#define AF_CONTROL_PAN_NOUT 0x00001B00 | AF_CONTROL_FILTER_SPECIFIC
+
-// Get the maximum probed power level for all channels, arg is a float*
-#define AF_CONTROL_VOLUME_PROBE_GET_MAX 10 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Set equalizer gain, arg is a control_ext with a float*
+#define AF_CONTROL_EQUALIZER_GAIN 0x00001C00 | AF_CONTROL_FILTER_SPECIFIC
-// Turn probing on and off, arg is binary
-#define AF_CONTROL_VOLUME_PROBE_ON_OFF 11 + AF_CONTROL_FILTER_SPECIFIC_BASE
-// Set equalizer gain, arg is an equalizer_t*
-#define AF_CONTROL_EQUALIZER_SET_GAIN 12 + AF_CONTROL_FILTER_SPECIFIC_BASE
+// Set delay length in seconds
+#define AF_CONTROL_DELAY_LEN 0x00001D00 | AF_CONTROL_FILTER_SPECIFIC
-// Get equalizer gain, arg is an equalizer_t*
-#define AF_CONTROL_EQUALIZER_GET_GAIN 13 + AF_CONTROL_FILTER_SPECIFIC_BASE
#endif /*__af_control_h */
4
6
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv23150/libao2
Modified Files:
ao_win32.c
Log Message:
10l fixes sync?
Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ao_win32.c 25 Oct 2002 16:18:33 -0000 1.1
+++ ao_win32.c 30 Dec 2002 13:52:29 -0000 1.2
@@ -59,7 +59,7 @@
if(uMsg != WOM_DONE)
return;
if(full_buffers==0) return; //no more data buffered!
- buffered_bytes=0; //buffer is empty
+ buffered_bytes-=BUFFER_SIZE;
--full_buffers;
}
3
2
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv6303/libvo
Modified Files:
vo_directx.c
Log Message:
Those pesky ^M DOS characters removed...
Index: vo_directx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_directx.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vo_directx.c 21 Dec 2002 23:49:33 -0000 1.9
+++ vo_directx.c 30 Dec 2002 20:41:58 -0000 1.10
@@ -37,7 +37,7 @@
#include "fastmemcpy.h"
#include "../input/input.h"
#include "../linux/keycodes.h"
-#include "../mp_msg.h"
+#include "../mp_msg.h"
#include "aspect.h"
static LPDIRECTDRAW2 g_lpdd = NULL; //DirectDraw Object
@@ -46,7 +46,7 @@
static LPDIRECTDRAWSURFACE g_lpddsBack = NULL; //Back surface
static LPDIRECTDRAWCLIPPER g_lpddclipper; //clipper object, can only be used without overlay
static DDSURFACEDESC ddsdsf; //surface descripiton needed for locking
-static HINSTANCE hddraw_dll; //handle to ddraw.dll
+static HINSTANCE hddraw_dll; //handle to ddraw.dll
static RECT rd; //rect of our stretched image
static RECT rs; //rect of our source image
static HWND hWnd=NULL; //handle to the window
@@ -324,9 +324,9 @@
mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>window destroyed\n");
if (g_lpdd != NULL) g_lpdd->lpVtbl->Release(g_lpdd);
mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>directdrawobject released\n");
- FreeLibrary( hddraw_dll);
- hddraw_dll= NULL;
- mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>ddraw.dll freed\n");
+ FreeLibrary( hddraw_dll);
+ hddraw_dll= NULL;
+ mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>ddraw.dll freed\n");
mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>uninited\n");
}
@@ -395,12 +395,12 @@
uint32_t xscreen = GetSystemMetrics(SM_CXSCREEN);
uint32_t yscreen = GetSystemMetrics(SM_CYSCREEN);
RECT rd_window;
- int32_t width,height;
+ int32_t width,height;
rd_window.top = 0;
rd_window.left = 0;
rd_window.right = xscreen;
rd_window.bottom = yscreen;
- aspect(&width,&height,A_ZOOM);
+ aspect(&width,&height,A_ZOOM);
rd.left = (xscreen-width)/2;
rd.right = rd.left+width;
rd.top = (yscreen-height)/2;
@@ -1022,7 +1022,7 @@
static void flip_page(void)
{
HRESULT dxresult;
- g_lpddsBack->lpVtbl->Unlock (g_lpddsBack,NULL);
+ g_lpddsBack->lpVtbl->Unlock (g_lpddsBack,NULL);
if (vo_doublebuffering)
{
// flip to the next image in the sequence
@@ -1035,15 +1035,15 @@
}
if(dxresult != DD_OK)mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>can't flip page\n");
}
- if(nooverlay)
- {
- DDBLTFX ddbltfx;
- // ask for the "NOTEARING" option
- memset( &ddbltfx, 0, sizeof(DDBLTFX) );
- ddbltfx.dwSize = sizeof(DDBLTFX);
- ddbltfx.dwDDFX = DDBLTFX_NOTEARING;
- g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx);
- }
+ if(nooverlay)
+ {
+ DDBLTFX ddbltfx;
+ // ask for the "NOTEARING" option
+ memset( &ddbltfx, 0, sizeof(DDBLTFX) );
+ ddbltfx.dwSize = sizeof(DDBLTFX);
+ ddbltfx.dwDDFX = DDBLTFX_NOTEARING;
+ g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx);
+ }
g_lpddsBack->lpVtbl->Lock(g_lpddsBack,NULL,&ddsdsf, DDLOCK_NOSYSLOCK | DDLOCK_WAIT , NULL);
dstride = ddsdsf.lPitch;
image = ddsdsf.lpSurface;
@@ -1162,13 +1162,13 @@
if(vm)fs=1;
image_format = format;
image_width = width;
- image_height = height;
- d_image_width = d_width;
- d_image_height = d_height;
- aspect_save_orig(image_width,image_height);
- aspect_save_prescale(d_image_width,d_image_height);
- aspect_save_screenres(GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));
- aspect(&d_image_width,&d_image_height,A_NOZOOM);
+ image_height = height;
+ d_image_width = d_width;
+ d_image_height = d_height;
+ aspect_save_orig(image_width,image_height);
+ aspect_save_prescale(d_image_width,d_image_height);
+ aspect_save_screenres(GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));
+ aspect(&d_image_width,&d_image_height,A_NOZOOM);
SetWindowText(hWnd,"");
if (g_lpddsBack != NULL) g_lpddsBack->lpVtbl->Release(g_lpddsBack);
g_lpddsBack = NULL;
6
9
Update of /cvsroot/mplayer/main/DOCS
In directory mail:/var/tmp.root/cvs-serv17604
Modified Files:
mplayer.1
Log Message:
cosmetics
Index: mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/mplayer.1,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -r1.290 -r1.291
--- mplayer.1 28 Dec 2002 14:04:56 -0000 1.290
+++ mplayer.1 28 Dec 2002 14:56:56 -0000 1.291
@@ -179,7 +179,8 @@
.SH "PLAYER OPTIONS (MPLAYER ONLY)"
.TP
.B \-, \-use-stdin
-Read data from stdin. \-idx option does not work in conjunction with this.
+Read data from stdin.
+The \-idx option does not work in conjunction with this.
.TP
.B \-autoq <quality> (use with \-vop pp)
Dynamically changes the level of postprocessing depending on available spare
@@ -210,21 +211,23 @@
video codec.
.TP
.B \-edl <filename>
-Enables edit decision list (EDL) actions during playback. Video will be
-skipped over and audio will be muted and unmuted according to the entries in
-the given file.
+Enables edit decision list (EDL) actions during playback.
+Video will be skipped over and audio will be muted and unmuted according to
+the entries in the given file.
See DOCS/documentation.html#edl for details on how to use this.
.TP
.B \-edlout <filename>
Creates a new file and writes edit decision list (EDL) records to that file.
During playback, when the user hits 'i', an entry to skip over the last two
-seconds of playback will be written to the file. This provides a starting
-point from which the user can fine-tune EDL entries later.
+seconds of playback will be written to the file.
+This provides a starting point from which the user can fine-tune EDL entries
+later.
See DOCS/documentation.html#edl for details.
.TP
.B \-fixed-vo (BETA CODE!)
Enforces a fixed video system for multiple files (one (un)initialisation for
-all files). Therefore only one window will be opened for all files.
+all files).
+Therefore only one window will be opened for all files.
Currently the following drivers are fixed-vo compliant: x11, xv, xvidix, xmga
and gl2.
.TP
@@ -240,9 +243,9 @@
Leads to image distortion!
.TP
.B \-identify
-Show file parameters in easy parsable format. The wrapper script
-TOOLS/midentify suppresses the other mplayer output and (hopefully)
-shellescapes the filenames.
+Show file parameters in easy parsable format.
+The wrapper script TOOLS/midentify suppresses the other mplayer output and
+(hopefully) shellescapes the filenames.
.TP
.B \-input <commands>
This option can be used to configure certain parts of the input system.
@@ -259,7 +262,7 @@
.IPs conf=<file>
Read alternative input.conf.
If given without pathname, ~/\:.mplayer is assumed.
-.IPs ar\-delay
+.In ar\-delay
Delay in msec before we start to autorepeat a key (0 to disable).
.IPs ar\-rate
How many key presses per second when we autorepeat.
@@ -270,7 +273,8 @@
.IPs js\-dev
Specifies the joystick device to use (default is /dev/\:input/\:js0).
.IPs file
-Read commands from the given file. Mostly useful with a fifo.
+Read commands from the given file.
+Mostly useful with a fifo.
.RE
.PD 1
.
@@ -438,11 +442,13 @@
If the number of output channels is smaller than the number of input channels,
results depend on the audio decoder (\-afm).
Mplayer asks the decoder to decode the audio into as many channels as
-specified. Now it's up to the decoder to fulfill the requirement. If the
-decoder outputs more channels than requested, the exceeding channels are
-truncated. This is usually only important when playing videos with AC3 audio
-(like DVDs). In that case liba52 does the decoding by default and correctly
-downmixes the audio into the requested number of channels.
+specified.
+Now it's up to the decoder to fulfill the requirement.
+If the decoder outputs more channels than requested, the exceeding channels
+are truncated.
+This is usually only important when playing videos with AC3 audio (like DVDs).
+In that case liba52 does the decoding by default and correctly downmixes the
+audio into the requested number of channels.
.I NOTE:
.br
@@ -603,9 +609,9 @@
.TP
.B \-rtsp-stream-over-tcp
Used with 'rtsp://' URLs to specify that the resulting incoming RTP and RTCP
-packets be streamed over TCP (using the same TCP connection as RTSP). This
-option may be useful if you have a broken Internet connection that does not
-pass incoming UDP packets (see http://www.live.com/mplayer/)
+packets be streamed over TCP (using the same TCP connection as RTSP).
+This option may be useful if you have a broken Internet connection that does
+not pass incoming UDP packets (see http://www.live.com/mplayer/)
.TP
.B \-skipopening
Skip DVD opening (dvdnav only).
@@ -841,15 +847,16 @@
.B \-sub <subtitle\ file>
Use/\:display this subtitle file.
.TP
-.B \-sub-bkg-alpha <0-255>
+.B \-sub-bkg-alpha <0\-255>
Specify the alpha channel value for subtitles and OSD backgrounds.
-Big values means more transparent. The 0 value is an exception and means
-completly transparent.
+Big values means more transparent.
+The 0 value is an exception and means completly transparent.
.TP
-.B \-sub-bkg-color <0-255>
+.B \-sub-bkg-color <0\-255>
Specify the color value for subtitles and OSD backgrounds.
Currently subtitles are grayscale so this value is equivalente to the
-intensity of the color. The 255 value means white and 0 black.
+intensity of the color.
+The 255 value means white and 0 black.
.TP
.B \-subcc \
Display DVD Closed Caption (CC) subtitles.
@@ -936,7 +943,8 @@
The value is the vertical position of the subtitle in % of the screen height.
.TP
.B \-subwidth <10\-100>
-Specify the maximum width of subtitles on the screen. Useful for TV-out.
+Specify the maximum width of subtitles on the screen.
+Useful for TV-out.
The value is the width of the subtitle in % of the screen width.
.TP
.B \-unicode
@@ -977,8 +985,9 @@
the exceeding channels are truncated.
.IPs format[=bps,f]
Select the format f and bits per sample bps used for output from the
-filter layer. The option bps is an integer and denotes bytes per
-sample. The format f is a string containing a concatenated mix of:
+filter layer.
+The option bps is an integer and denotes bytes per sample.
+The format f is a string containing a concatenated mix of:
.br
alaw, mulaw or imaadpcm
.br
@@ -993,17 +1002,19 @@
This filter is not reentrant and can therefore only be enabled once for every
audio stream.
.RSss
-v: desired gain in dB for all channels in the stream. The gain can be
-set from -200dB to +40dB (where -200dB mutes the sound completely and
-+40dB equals a gain of 1000). The default gain is -20dB.
+v: desired gain in dB for all channels in the stream.
+The gain can be set from -200dB to +40dB (where -200dB mutes the sound
+completely and +40dB equals a gain of 1000).
+The default gain is -20dB.
.br
sc: enable soft clipping.
.br
-pr: enable probing of the volume level for each audio stream. Both the
-maximum and instantaneous volume is probed. The instantaneous volume
-can only be accessed through the runtime interface, but the maximum
-volume is printed at the end of the movie. This value can be used when
-transcoding movies to maximize the utilization of the dynamic range.
+pr: enable probing of the volume level for each audio stream.
+Both the maximum and instantaneous volume is probed.
+The instantaneous volume can only be accessed through the runtime interface,
+but the maximum volume is printed at the end of the movie.
+This value can be used when transcoding movies to maximize the utilization
+of the dynamic range.
.br
en: enable and disable the volume control.
.REss
@@ -1178,10 +1189,11 @@
format so all formats supported by MPlayer should play out of the box (if
you have the CPU power needed to encode on the fly).
The overlay chipset used on the dxr2 is of pretty bad quality but the default
-settings should work for everybody. The OSD may be usable with the
-overlay (not on TV) by drawing it in the colorkey. With the default colorkey
-settings you may get variable results, usually you will see the colorkey
-around the characters or some other funny effect.
+settings should work for everybody.
+The OSD may be usable with the overlay (not on TV) by drawing it in the
+colorkey.
+With the default colorkey settings you may get variable results, usually you
+will see the colorkey around the characters or some other funny effect.
Buf if you properly adjust the colorkey settings you should be able to get
acceptable results.
.
@@ -1622,9 +1634,9 @@
Do not play/\:encode sound.
.TP
.B \-pp <quality> (see \-vop pp option too!)
-Set postprocess level of the DLL. This option is NO LONGER USABLE with
-MPlayer's postprocess filter, but only with Win32 DirectShow DLLs which
-have interal postprocessing routine.
+Set postprocess level of the DLL.
+This option is NO LONGER USABLE with MPlayer's postprocess filter, but only
+with Win32 DirectShow DLLs which have interal postprocessing routine.
The valid range of \-pp value vary on codecs, mostly
0\-6, where 0=disable 6=slowest/\:best.
@@ -1959,7 +1971,8 @@
.REss
.IPs "perspective=x0:y0:x1:y1:x2:y2:x3:y3:t"
.RSss
-x0,y0,...: coordinates of the topleft, topright, bottomleft, bottomright corners
+x0,y0,...: coordinates of the topleft, topright, bottomleft, bottomright
+corners
.br
t: linear (0) or cubic resampling (1)
.REss
@@ -2075,7 +2088,8 @@
pass=2.
.IPs vbrpass=<0\-2>
Override the pass argument and use XviD VBR Library instead of DivX4
-VBR. Available options are:
+VBR.
+Available options are:
.
.RSss
0: one pass encoding (as in not putting pass on the command line)
@@ -2337,9 +2351,11 @@
2: second pass
.REss
.IPs aspect=<x.x/y.y>
-Store movie aspect internally, just like MPEG files. Much nicer solution than
-rescaling, because quality isn't decreased. Only MPlayer will play these files
-back correctly, other players will display them with wrong aspect. Example:
+Store movie aspect internally, just like MPEG files.
+Much nicer solution than rescaling, because quality isn't decreased.
+Only MPlayer will play these files back correctly, other players will display
+them with wrong aspect.
+Example:
.RSss
aspect=16.0/9.0
.REss
3
2
Update of /cvsroot/mplayer/main/DOCS/French
In directory mail:/var/tmp.root/cvs-serv28191/main/DOCS/French
Modified Files:
mplayer.1
Log Message:
sync
Index: mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/French/mplayer.1,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mplayer.1 31 Dec 2002 17:21:03 -0000 1.10
+++ mplayer.1 31 Dec 2002 18:47:43 -0000 1.11
@@ -2742,7 +2742,7 @@
.PD 1
.
.TP
-.B \-of <format>
+.B \-of <format> (CODE BETA!)
Encode dans le format spécifié.
Utilisez \-of help pour obtenir une liste des formats disponibles.
1
0
Update of /cvsroot/mplayer/main/help
In directory mail:/var/tmp.root/cvs-serv27255/main/help
Modified Files:
help_mp-fr.h
Log Message:
sync
Index: help_mp-fr.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-fr.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- help_mp-fr.h 10 Dec 2002 21:19:29 -0000 1.24
+++ help_mp-fr.h 31 Dec 2002 18:45:41 -0000 1.25
@@ -1,5 +1,5 @@
// sync'ed with help_mp-en.h 1.66
-// Updates & fixes by pl <p_l(a)gmx.fr>
+// Updates & fixes by pl <p_l(a)gmx.fr> & n.le gaillart <n(a)tourmentine.com>
// Original transation by Firebird <firebird(a)chez.com>
// ========================= Aide MPlayer ===========================
@@ -7,51 +7,50 @@
#ifdef HELP_MP_DEFINE_STATIC
static char* banner_text=
"\n\n"
-"MPlayer " VERSION "(C) 2000-2002 Arpad Gereoffy (lisez les DOCS!)\n"
+"MPlayer " VERSION "(C) 2000-2002 Arpad Gereoffy (voir les DOCS)\n"
"\n";
static char help_text[]=
-"Utilisation: mplayer [options] [répertoire/]fichier\n"
+"Utilisation: mplayer [options] [url|répertoire/]fichier\n"
"\n"
-"Options de base (voir la page man pour TOUTES les autres options):\n"
+"Options de base: (liste complète dans la page de man)\n"
" -vo <pil[:pér]> Sél. le pil. et le périph. vidéo ('-vo help' pour la liste)\n"
" -ao <pil[:pér]> Sél. le pil. et le périph. audio ('-ao help' pour la liste)\n"
#ifdef HAVE_VCD
-" -vcd <n°piste> Joue à partir d'un VCD plutôt que d'un fichier\n"
+" -vcd <n°piste> Lit une piste VCD (Video CD) plutôt qu'un fichier\n"
#endif
#ifdef HAVE_LIBCSS
" -dvdauth <pér> Précise le chemin du lecteur DVD (pour les DVD cryptés)\n"
#endif
#ifdef USE_DVDREAD
-" -dvd <nrtitre> Joue à partir du lecteur DVD plutôt que d'un fichier\n"
-" -alang/-slang Sélectionne la langue pour l'audio/les sous-titres (fr,en,...)\n"
+" -dvd <n°titre> Joue un titre DVD plutôt qu'un fichier\n"
+" -alang/-slang Sélectionne la langue audio/sous-titres (code pays à 2 lettres)\n"
#endif
" -ss <temps> Démarre la lecture à 'temps' (temps en secondes ou hh:mm:ss)\n"
" -nosound Ne joue aucun son\n"
-" -fs -vm -zoom Options plein-écran (fs: plein-écran, vm: changement de mode\n"
-" vidéo, zoom: changement de taille logiciel)\n"
-" -x <x> -y <y> Résolution de l'affichage (chgts. de mode vidéo ou zoom soft)\n"
+" -fs Lecture plein-écran (ou -vm, -zoom, détails dans la page de man)\n"
+" -x <x> -y <y> Résolution de l'affichage (à utiliser avec -vm ou -zoom)\n"
" -sub <fich> Spécifie les sous-titres à utiliser (cf. -subfps, -subdelay)\n"
" -playlist <fich> Spécifie la liste des fichiers à jouer\n"
" -vid x -aid y Spécifie les flux vidéo (x) et audio (y) à jouer\n"
" -fps x -srate y Options pour changer les fréq. vidéo (x fps) et audio (y Hz)\n"
-" -pp <qualité> Filtres de sorties (voir la page de man et les docs)\n"
+" -pp <qualité> Active le filtre de postprocessing (détails dans la page de man)\n"
" -framedrop saut d'images (pour les machines lentes)\n"
"\n"
-"Fonctions au clavier: (voir la page man et regarder dans input.conf)\n"
+"Fonctions au clavier: (liste complète dans la page de man, voir aussi input.conf)\n"
" <- ou -> + / - 10 secondes\n"
" haut ou bas + / - 1 minute\n"
" PgUp ou PgDown + / - de 10 minutes\n"
" < ou > Fichier suivant / précédent dans la playlist\n"
" p ou ESPACE Pause (presser n'importe quelle touche pour continuer)\n"
-" q ou ESC Quitter\n"
+" q ou ESC Arrète la lecture et quitte le programme\n"
" + ou - Synchro audio / vidéo: +/- 0.1 seconde\n"
" o Change l'OSD: rien / barre de recherche / barre rech. + temps\n"
" * ou / Augmente/diminue le volume PCM\n"
" z ou x Synchro des sous-titres: +/- 0.1 seconde\n"
-" r ou t Pos. des sous-titres: plus haut/plus bas (cf. -vop expand !)\n"
+" r ou t Pos. des sous-titres: plus haut/plus bas, voir aussi -vop expand\n"
"\n"
-" *** VOIR LA PAGE MAN POUR LES DETAILS ET LES AUTRES OPTIONS (AVANCEES) ***\n"
+" * * * VOIR LA PAGE MAN POUR LES DETAILS ET LES AUTRES OPTIONS ET TOUCHES (AVANCEES) * * *\n"
"\n";
#endif
@@ -67,79 +66,80 @@
#define MSGTR_NoHomeDir "Ne peut trouver répertoire HOME\n"
#define MSGTR_GetpathProblem "Problème get_path(\"config\")\n"
#define MSGTR_CreatingCfgFile "Création du fichier de config: %s\n"
-#define MSGTR_InvalidVOdriver "Nom du pilote de sortie vidéo invalide: %s\nUtiliser '-vo help' pour avoir une liste des pilotes disponibles.\n"
-#define MSGTR_InvalidAOdriver "Nom du pilote de sortie audio invalide: %s\nUtiliser '-ao help' pour avoir une liste des pilotes disponibles.\n"
-#define MSGTR_CopyCodecsConf "Copiez/liez etc/codecs.conf (dans le source de MPlayer) vers ~/.mplayer/codecs.conf)\n"
+#define MSGTR_InvalidVOdriver "Nom du pilote de sortie vidéo invalide: %s\nUtilisez '-vo help' pour avoir une liste des pilotes disponibles.\n"
+#define MSGTR_InvalidAOdriver "Nom du pilote de sortie audio invalide: %s\nUtilisez '-ao help' pour avoir une liste des pilotes disponibles.\n"
+#define MSGTR_CopyCodecsConf "Copiez/liez etc/codecs.conf depuis le source de MPlayer vers ~/.mplayer/codecs.conf)\n"
#define MSGTR_CantLoadFont "Ne peut charger la police: %s\n"
#define MSGTR_CantLoadSub "Ne peut charger les sous-titres: %s\n"
#define MSGTR_ErrorDVDkey "Erreur avec la clé du DVD.\n"
#define MSGTR_CmdlineDVDkey "La clé DVD demandée sera utilisée pour le décryptage.\n"
#define MSGTR_DVDauthOk "La séquence d'authentification DVD semble OK.\n"
-#define MSGTR_DumpSelectedStreamMissing "dump: FATAL: le flux sélectionné est manquant\n"
-#define MSGTR_CantOpenDumpfile "Ne peut ouvrir un fichier dump!!!\n"
-#define MSGTR_CoreDumped "core dumped :)\n"
-#define MSGTR_FPSnotspecified "FPS non spécifié (ou invalide) dans l'entête! Utiliser l'option -fps!\n"
-#define MSGTR_TryForceAudioFmtStr "Tente de forcer famille de pilotes codec audio de famille %s ...\n"
-#define MSGTR_CantFindAfmtFallback "Ne peut trouver de codec audio pour famille de pilotes imposée, utilisation d'autres.\n"
-#define MSGTR_CantFindAudioCodec "Ne peut trouver codec pour format audio 0x%X !\n"
+#define MSGTR_DumpSelectedStreamMissing "dump: FATAL: le flux sélectionné est manquant!\n"
+#define MSGTR_CantOpenDumpfile "Impossible d'ouvrir le fichier dump!!!\n"
+#define MSGTR_CoreDumped "Core dumped :)\n"
+#define MSGTR_FPSnotspecified "FPS non spécifié ou invalide dans l'entête! Utilisez l'option -fps.\n"
+#define MSGTR_TryForceAudioFmtStr "Tente de forcer la famille de pilotes %s du codec audio ...\n"
+#define MSGTR_CantFindAfmtFallback "Ne peut trouver de codec audio pour la famille de pilotes imposée, utilisation d'autres.\n"
+#define MSGTR_CantFindAudioCodec "Ne peut trouver de codec pour le format audio 0x%X !\n"
#define MSGTR_TryUpgradeCodecsConfOrRTFM "*** Tentez de mettre à jour %s à partir de etc/codecs.conf\n*** Si ce n'est toujours pas bon, alors lisez DOCS/codecs.html ou DOCS/fr/codecs.html !\n"
-#define MSGTR_CouldntInitAudioCodec "Ne peut trouver de codec audio! -> Aucun son\n"
-#define MSGTR_TryForceVideoFmtStr "Tente de forcer famille de pilotes codec vidéo %s ...\n"
+#define MSGTR_CouldntInitAudioCodec "Impossible d'initialiser le codec audio -> pas de son\n"
+#define MSGTR_TryForceVideoFmtStr "Tente de forcer famille de pilotes %s du codec vidéo %s ...\n"
#define MSGTR_CantFindVideoCodec "Ne peut trouver codec pour format vidéo 0x%X !\n"
-#define MSGTR_VOincompCodec "Désolé, le pilote de sortie vidéo choisi n'est pas compatible avec ce codec.\n"
-#define MSGTR_CannotInitVO "FATAL: Ne peut initialiser le pilote vidéo!\n"
-#define MSGTR_CannotInitAO "Ne peut ouvrir/initialiser le périphérique audio -> Aucun son\n"
-#define MSGTR_StartPlaying "Démarre la reproduction...\n"
-#define MSGTR_SystemTooSlow "\n***********************************************************************"\
- "\n** Votre système est trop lent. Essayez l'option -framedrop ou RTFM! **"\
- "\n***********************************************************************\n"\
- "!!! Raisons possibles, problèmes, solutions: \n"\
- "- Le plus probable: pilote audio _buggé_ => essayer -ao sdl ou\n"\
- " ALSA 0.5 ou l'émulation OSS d'ALSA 0.9 => lire DOCS/sound.html\n"\
- " Essayer aussi avec -autosync 30 ou d'autres valeurs.\n"\
- "- Vidéo lente => essayer avec plusieurs pilotes -vo (pour la liste: -vo help) ou\n"\
- " avec -framedrop => lire DOCS/video.html\n"\
- "- CPU lent => éviter les gros DVD/DivX => essayer -hardframedrop\n"\
- "- Fichier corrompu => essayer des mélanges de -nobps -ni -mc 0 -forceidx\n"\
- "- Pour jouer d'un média lent (nfs/smb, dvd, vcd, ...), essayer avec -cache 8192\n"\
- "- -cache est utilisé avec un fichier AVI mal multiplexé => essayer avec -nocache\n"\
- "Si rien de tout cela ne résout le problème, lire DOCS/bugreports.html !\n\n"
+#define MSGTR_VOincompCodec "Le pilote de sortie vidéo choisi n'est pas compatible avec ce codec.\n"
+#define MSGTR_CannotInitVO "FATAL: Ne peut initialiser le pilote vidéo.\n"
+#define MSGTR_CannotInitAO "Ne peut ouvrir/initialiser le périphérique audio -> aucun son\n"
+#define MSGTR_StartPlaying "Démarre la lecture...\n"
+#define MSGTR_SystemTooSlow "\n\n"\
+" ************************************************************"\n"\
+" **** Votre système est trop LENT pour jouer ce fichier! ****"\n"\
+" ************************************************************\n"\
+"!!! Raisons possibles, problèmes, solutions: \n"\
+"- Le plus courant: pilote _audio_ cassé/bogué: Essayez -ao sdl ou utilisez\n"\
+" ALSA 0.5 ou l'émulation OSS d'ALSA 0.9. Lisez DOCS/sound.html pour plus d'astuces!\n"\
+" Essayez aussi avec -autosync 30 ou d'autres valeurs.\n"\
+"- Vidéo lente. Essayez avec un pilotes -vo différent (-vo help pour la liste) ou\n"\
+" esssayez avec -framedrop! lisez DOCS/video.html pour les astuces de réglage.\n"\
+"- CPU lent. Evitez de lire de gros DVD/DivX sur un CPU lent! essayez -hardframedrop.\n"\
+"- Fichier corrompu => essayez des mélanges de: -nobps -ni -mc 0 -forceidx\n"\
+"- Pour jouer depuis un média lent (nfs/smb, DVD, VCD, etc.), essayez avec -cache 8192\n"\
+"- -cache est utilisé avec un fichier AVI mal multiplexé? Essayez avec -nocache\n"\
+"Si rien de tout cela ne résout le problème, lisez DOCS/bugreports.html.\n\n"
#define MSGTR_NoGui "MPlayer a été compilé SANS support GUI!\n"
#define MSGTR_GuiNeedsX "MPlayer GUI a besoin de X11!\n"
#define MSGTR_Playing "Joue %s\n"
-#define MSGTR_NoSound "Audio: Aucun son!!!\n"
+#define MSGTR_NoSound "Audio: aucun son!!!\n"
#define MSGTR_FPSforced "FPS forcé à %5.3f (ftime: %5.3f)\n"
-#define MSGTR_CompiledWithRuntimeDetection "Compilé avec détection du CPU à l'exécution - attention, c'est sous-optimal! Pour de meilleures performances, recompilez MPlayer avec l'option --disable-runtime-cpudetection\n"
+#define MSGTR_CompiledWithRuntimeDetection "Compilé avec détection du CPU à l'exécution - ATTENTION, ce n'est pas optimal! Pour de meilleures performances, recompilez MPlayer avec l'option --disable-runtime-cpudetection\n"
#define MSGTR_CompiledWithCPUExtensions "Compilé pour CPU x86 avec les extensions:"
-#define MSGTR_AvailableVideoOutputPlugins "Plugins de sortie vidéo:\n"
-#define MSGTR_AvailableVideoOutputDrivers "Modules de sortie vidéo disponibles:\n"
-#define MSGTR_AvailableAudioOutputDrivers "Modules de sortie audio disponibles::\n"
+#define MSGTR_AvailableVideoOutputPlugins "Plugins de sortie vidéo disponibles:\n"
+#define MSGTR_AvailableVideoOutputDrivers "Pilotes de sortie vidéo disponibles:\n"
+#define MSGTR_AvailableAudioOutputDrivers "Pilotes de sortie audio disponibles::\n"
#define MSGTR_AvailableAudioCodecs "Codecs audio disponibles:\n"
#define MSGTR_AvailableVideoCodecs "Codecs vidéo disponibles:\n"
-#define MSGTR_AvailableAudioFm "\n(Familles de) Codecs audio disponibles (inclus à la compilation):\n"
-#define MSGTR_AvailableVideoFm "\n(Familles de) Codecs vidéo disponibles (inclus à la compilation):\n"
+#define MSGTR_AvailableAudioFm "\nFamilles/pilotes de codecs audio disponibles (inclus à la compilation):\n"
+#define MSGTR_AvailableVideoFm "\nFamilles/pilotes de codecs vidéo disponibles (inclus à la compilation):\n"
#define MSGTR_UsingRTCTiming "Utilisation de la synchronisation matérielle par RTC (%ldHz)\n"
#define MSGTR_CannotReadVideoProperties "Vidéo: ne pas pas lire les propriétés\n"
#define MSGTR_NoStreamFound "Pas de flux trouvé\n"
#define MSGTR_InitializingAudioCodec "Initialisation des codecs audio...\n"
-#define MSGTR_ErrorInitializingVODevice "Erreur à l'ouverture/l'initialisation de la sortie vidéo choisie (-vo)!\n"
+#define MSGTR_ErrorInitializingVODevice "Erreur à l'ouverture/initialisation de la sortie vidéo choisie (-vo)!\n"
#define MSGTR_ForcedVideoCodec "Codec vidéo forcé: %s\n"
#define MSGTR_ForcedAudioCodec "Codec audio forcé: %s\n"
#define MSGTR_AODescription_AOAuthor "AO: Description: %s\nAO: Auteur: %s\n"
#define MSGTR_AOComment "AO: Commentaire: %s\n"
-#define MSGTR_Video_NoVideo "Vidéo: pas de vidéo!!!\n"
-#define MSGTR_NotInitializeVOPorVO "\nFATAL: n'a pas pu initialiser les filtres vidéo (-vop) ou la sortie vidéo (-vo) !\n"
-#define MSGTR_Paused "\n------ EN PAUSE -------\r"
+#define MSGTR_Video_NoVideo "Vidéo: Pas de vidéo!!!\n"
+#define MSGTR_NotInitializeVOPorVO "\nFATAL: n'a pas pu initialiser les filtres vidéo (-vop) ou la sortie vidéo (-vo).\n"
+#define MSGTR_Paused "\n================= PAUSE =================\n"
#define MSGTR_PlaylistLoadUnable "\nNe peut pas charger la liste de lecture %s\n"
// mencoder.c
-#define MSGTR_MEncoderCopyright "(C) 2000-2002 Arpad Gereoffy (voir les DOCS!)\n"
+#define MSGTR_MEncoderCopyright "(C) 2000-2002 Arpad Gereoffy (voir les DOCS)\n"
#define MSGTR_UsingPass3ControllFile "Utilisation du fichier de contrôle de la passe 3\n"
#define MSGTR_MissingFilename "\nNom de fichier manquant!\n\n"
-#define MSGTR_CannotOpenFile_Device "Ne peut pas ouvrir le fichier/le périph.\n"
-#define MSGTR_ErrorDVDAuth "Erreur à l'authentification du DVD...\n"
+#define MSGTR_CannotOpenFile_Device "Ne peut pas ouvrir le fichier/périph.\n"
+#define MSGTR_ErrorDVDAuth "Erreur dans l'authentification du DVD.\n"
#define MSGTR_CannotOpenDemuxer "Ne peut pas ouvrir le démultiplexeur\n"
#define MSGTR_NoAudioEncoderSelected "\nPas d'encodeur audio (-oac) choisi! Choisissez en un ou utilisez -nosound. Essayez -oac help !\n"
#define MSGTR_NoVideoEncoderSelected "\nPas d'encodeur vidéo (-ovc) choisi! Choisissez-en un, essayez -ovc help !\n"
@@ -147,18 +147,18 @@
#define MSGTR_EncoderOpenFailed "N'a pas pu ouvrir l'encodeur\n"
#define MSGTR_ForcingOutputFourcc "Code fourcc de sortie forcé à %x [%.4s]\n"
#define MSGTR_WritingAVIHeader "Ecriture de l'entête AVI...\n"
-#define MSGTR_DuplicateFrames "\n%d trame(s) dupliquée(s)!!! \n"
-#define MSGTR_SkipFrame "\ntrame supprimée!!! \n"
-#define MSGTR_ErrorWritingFile "%s: erreur à l'écriture du fichier.\n"
+#define MSGTR_DuplicateFrames "\n%d trame(s) dupliquée(s)!!!\n"
+#define MSGTR_SkipFrame "\nTrame supprimée!!! \n"
+#define MSGTR_ErrorWritingFile "%s: Erreur durant l'écriture du fichier.\n"
#define MSGTR_WritingAVIIndex "\nEcriture de l'index AVI...\n"
#define MSGTR_FixupAVIHeader "Correction de l'entête AVI...\n"
#define MSGTR_RecommendedVideoBitrate "Bitrate vidéo recommandé pour %s CD: %d\n"
-#define MSGTR_VideoStreamResult "\nFlux vidéo: %8.3f kbit/s (%d bps) size: %d bytes %5.3f secs %d trames\n"
-#define MSGTR_AudioStreamResult "\nFlux audio: %8.3f kbit/s (%d bps) size: %d bytes %5.3f secs\n"
+#define MSGTR_VideoStreamResult "\nFlux vidéo: %8.3f kbit/s (%d bps) taille: %d octets %5.3f secs %d trames\n"
+#define MSGTR_AudioStreamResult "\nFlux audio: %8.3f kbit/s (%d bps) taille: %d octets %5.3f secs\n"
// open.c, stream.c:
#define MSGTR_CdDevNotfound "Lecteur CD-ROM '%s' non trouvé!\n"
-#define MSGTR_ErrTrackSelect "Erreur lors du choix de la piste VCD!"
+#define MSGTR_ErrTrackSelect "Erreur lors du choix de la piste VCD.\n"
#define MSGTR_ReadSTDIN "Lecture depuis stdin...\n"
#define MSGTR_UnableOpenURL "Ne peut ouvrir l'URL: %s\n"
#define MSGTR_ConnToServer "Connecté au serveur: %s\n"
@@ -169,7 +169,7 @@
#define MSGTR_SMBNotCompiled "MPlayer n'a pas été compilé avec le support SMB.\n"
#define MSGTR_CantOpenDVD "Ne peut ouvrir le lecteur DVD: %s\n"
-#define MSGTR_DVDwait "Lecture de la structure du disque, veuillez attendre...\n"
+#define MSGTR_DVDwait "Lecture de la structure du disque, veuillez patienter...\n"
#define MSGTR_DVDnumTitles "Il y a %d titres sur ce DVD.\n"
#define MSGTR_DVDinvalidTitle "Numéro de titre DVD invalide: %d\n"
#define MSGTR_DVDnumChapters "Il y a %d chapitres sur ce titre DVD.\n"
@@ -178,44 +178,43 @@
#define MSGTR_DVDinvalidAngle "Numéro de séquence DVD invalide: %d\n"
#define MSGTR_DVDnoIFO "Ne peut ouvrir le fichier IFO pour le titre DVD %d.\n"
#define MSGTR_DVDnoVOBs "Ne peut ouvrir titre VOBS (VTS_%02d_1.VOB).\n"
-#define MSGTR_DVDopenOk "DVD ouvert avec succès!\n"
+#define MSGTR_DVDopenOk "DVD ouvert avec succès.\n"
// demuxer.c, demux_*.c:
-#define MSGTR_AudioStreamRedefined "Attention! Entête du flux audio %d redéfini!\n"
-#define MSGTR_VideoStreamRedefined "Attention! Entête du flux vidéo %d redéfini!\n"
-#define MSGTR_TooManyAudioInBuffer "\nDEMUXER: Trop (%d dans %d octets) de packets audio dans le tampon!\n"
-#define MSGTR_TooManyVideoInBuffer "\nDEMUXER: Trop (%d dans %d octets) de packets vidéo dans le tampon!\n"
-#define MSGTR_MaybeNI "Peut-être jouez-vous un flux/fichier mal multiplexé, ou le codec n'est pas là...\n"\
- "Pour les fichier .AVI, essayez l'option -ni."
-#define MSGTR_SwitchToNi "\nFichier .AVI mal multiplexé - passage en mode -ni!\n"
-#define MSGTR_Detected_XXX_FileFormat "Fichier de type %s détecté!\n"
-#define MSGTR_DetectedAudiofile "Fichier audio détecté!\n"
-#define MSGTR_NotSystemStream "Pas un flux de type MPEG System... (peut-être un flux de transport?)\n"
+#define MSGTR_AudioStreamRedefined "ATTENTION: Entête du flux audio %d redéfini.\n"
+#define MSGTR_VideoStreamRedefined "ATTENTION: Entête du flux vidéo %d redéfini.\n"
+#define MSGTR_TooManyAudioInBuffer "\nDEMUXER: Trop (%d dans %d octets) de paquets audio dans le tampon!\n"
+#define MSGTR_TooManyVideoInBuffer "\nDEMUXER: Trop (%d dans %d octets) de paquets vidéo dans le tampon!\n"
+#define MSGTR_MaybeNI "Peut-être que vous jouez un flux/fichier mal multiplexé, ou qu le codec a échoué?\n" \
+ "Pour les fichier .AVI, essayez de forcer le mode non-entrelaçé avec l'option -ni.\n"
+#define MSGTR_SwitchToNi "\nFichier .AVI non entrelaçé - passage en mode -ni...\n"
+#define MSGTR_Detected_XXX_FileFormat "Fichier de type %s détecté.\n"
+#define MSGTR_DetectedAudiofile "Fichier audio détecté.\n"
+#define MSGTR_NotSystemStream "Pas un flux de type MPEG System... (peut-être un Flux de Transport?)\n"
#define MSGTR_InvalidMPEGES "Flux MPEG-ES invalide??? Contactez l'auteur, c'est peut-être un bug :(\n"
#define MSGTR_FormatNotRecognized "========== Désolé, ce format de fichier n'est pas reconnu/supporté ===========\n"\
- "========= Si ce fichier est un fichier AVI, ASF ou MPEG en bon état, =========\n"\
- "======================= merci de contacter l'auteur ! ========================\n"
-#define MSGTR_MissingVideoStream "Ne peut trouver de flux vidéo!\n"
-#define MSGTR_MissingAudioStream "Ne peut trouver de flux audio... -> pas de son\n"
+ "== Si ce fichier est un flux AVI, ASF ou MPEG, merci de contacter l'auteur! ==\n"
+#define MSGTR_MissingVideoStream "Aucun flux vidéo trouvé.\n"
+#define MSGTR_MissingAudioStream "Aucun flux audio trouvé -> pas de son\n"
#define MSGTR_MissingVideoStreamBug "Flux vidéo manquant!? Contactez l'auteur, c'est peut-être un bug :(\n"
-#define MSGTR_DoesntContainSelectedStream "Demux: le fichier ne contient pas le flux audio ou vidéo sélectionné\n"
+#define MSGTR_DoesntContainSelectedStream "Demux: le fichier ne contient pas le flux audio ou vidéo sélectionné.\n"
#define MSGTR_NI_Forced "Forcé"
#define MSGTR_NI_Detected "Détecté"
-#define MSGTR_NI_Message "%s format de fichier AVI mal multiplexé!\n"
+#define MSGTR_NI_Message "%s format de fichier AVI NON-ENTRELACE.\n"
#define MSGTR_UsingNINI "Utilise le support des fichiers AVI mal multiplexés!\n"
-#define MSGTR_CouldntDetFNo "Ne peut déterminer le nombre de frames (pour recherche absolue)\n"
+#define MSGTR_CouldntDetFNo "Ne peut déterminer le nombre de trames (pour recherche absolue)\n"
#define MSGTR_CantSeekRawAVI "Ne peut chercher dans un flux .AVI brut! (Index requis, essayez l'option -idx!)\n"
#define MSGTR_CantSeekFile "Ne peut chercher dans ce fichier! \n"
-#define MSGTR_EncryptedVOB "Fichier VOB crypté (support libcss NON compilé!) Lire DOCS/cd-dvd.html\n"
-#define MSGTR_EncryptedVOBauth "Flux crypté mais l'authentification n'a pas été demandée explicitement!\n"
+#define MSGTR_EncryptedVOB "Fichier VOB crypté (support libcss non compilé!) Lire DOCS/cd-dvd.html\n"
+#define MSGTR_EncryptedVOBauth "Flux crypté mais vous n'avez pas demandé d'authentification!!\n"
-#define MSGTR_MOVcomprhdr "MOV: Les entêtes compressées ne sont pas (encore) supportés!\n"
-#define MSGTR_MOVvariableFourCC "MOV: Attention! Variable FOURCC détectée!?\n"
-#define MSGTR_MOVtooManyTrk "MOV: Attention! Trop de pistes!"
+#define MSGTR_MOVcomprhdr "MOV: Les entêtes compressées ne sont pas (encore) supportées!\n"
+#define MSGTR_MOVvariableFourCC "MOV: ATTENTION: Variable FOURCC détectée!?\n"
+#define MSGTR_MOVtooManyTrk "MOV: ATTENTION: Trop de pistes!"
#define MSGTR_FoundAudioStream "==> Flux audio trouvé: %d\n"
#define MSGTR_FoundVideoStream "==> Flux vidéo trouvé: %d\n"
#define MSGTR_DetectedTV "TV détectée! ;-)\n"
@@ -266,17 +265,17 @@
// LIRC:
#define MSGTR_SettingUpLIRC "Mise en place du support LIRC...\n"
#define MSGTR_LIRCdisabled "Vous ne pourrez pas utiliser votre télécommande\n"
-#define MSGTR_LIRCopenfailed "Impossible d'activer le support LIRC!\n"
-#define MSGTR_LIRCcfgerr "Impossible de lire le fichier de configuration LIRC %s !\n"
+#define MSGTR_LIRCopenfailed "Impossible d'activer le support LIRC.\n"
+#define MSGTR_LIRCcfgerr "Impossible de lire le fichier de config de LIRC %s.\n"
// vf.c
-#define MSGTR_CouldNotFindVideoFilter "N'a pas pu trouvé le filtre vidéo '%s'\n"
+#define MSGTR_CouldNotFindVideoFilter "N'a pas pu trouver le filtre vidéo '%s'\n"
#define MSGTR_CouldNotOpenVideoFilter "N'a pas pu ouvrir le filtre vidéo '%s'\n"
#define MSGTR_OpeningVideoFilter "Ouverture du filtre vidéo: "
#define MSGTR_CannotFindColorspace "Ne peut pas trouver d'espace de couleurs commun, même en utilisant 'scale' :(\n"
// vd.c
-#define MSGTR_CodecDidNotSet "VDec: le codec n'a pas défini sh->disp_w and sh->disp_h, essai de contournement!\n"
+#define MSGTR_CodecDidNotSet "VDec: le codec n'a pas défini sh->disp_w et sh->disp_h, essai de contournement!\n"
#define MSGTR_VoConfigRequest "VDec: requête de configuration du vo - %d x %d (csp préferé: %s)\n"
#define MSGTR_CouldNotFindColorspace "N'a pas pu trouver d'espace de couleur correspondant - nouvel essai avec -vop scale...\n"
#define MSGTR_MovieAspectIsSet "L'aspect du film est %.2f:1 - pré-redimensionnement à l'aspect correct.\n"
@@ -497,7 +496,7 @@
#define MSGTR_PREFERENCES_AutoSyncValue "Autosynchro: "
// --- messagebox
-#define MSGTR_MSGBOX_LABEL_FatalError "Erreur fatale ..."
+#define MSGTR_MSGBOX_LABEL_FatalError "Erreur fatale!"
#define MSGTR_MSGBOX_LABEL_Error "Erreur!"
#define MSGTR_MSGBOX_LABEL_Warning "Attention!"
1
0