mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 06:03:45 +01:00
Merge svn changes up to r30748
This commit is contained in:
commit
e74708f619
@ -2830,9 +2830,9 @@ OS/2 KAI audio output driver
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs uniaud
|
||||
Force UNIAUD mode
|
||||
Force UNIAUD mode.
|
||||
.IPs dart
|
||||
Force DART mode
|
||||
Force DART mode.
|
||||
.IPs (no)share
|
||||
Open audio in shareable or exclusive mode.
|
||||
.IPs bufsize=<size>
|
||||
@ -5791,11 +5791,11 @@ Use 2 to get only even dimensions (needed for 4:2:2 video).
|
||||
16 is best when encoding to most video codecs.
|
||||
.br
|
||||
.IPs <reset>
|
||||
Counter that determines after how many frames cropdetect will reset
|
||||
the previously detected largest video area and start over to detect
|
||||
the current optimal crop area. This can be useful when channel
|
||||
logos distort the video area. 0 indicates never reset and return
|
||||
the largest area encountered during playback. (default: 0).
|
||||
Counter that determines after how many frames cropdetect will reset the
|
||||
previously detected largest video area and start over to detect the current
|
||||
optimal crop area (default: 0).
|
||||
This can be useful when channel logos distort the video area.
|
||||
0 indicates never reset and return the largest area encountered during playback.
|
||||
.RE
|
||||
.PD 1
|
||||
.
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" synced with r30336
|
||||
.\" synced with r30610
|
||||
.\" Encoding: iso-8859-1
|
||||
.\" MPlayer (C) 2000-2010 MPlayer Team
|
||||
.\" Questa pagina di manuale è stata fatta da Gabucino, Diego Biurrun,
|
||||
@ -462,8 +462,6 @@ Attiva/\:disattiva il televideo.
|
||||
Va alla pagina televideo successiva/\:precedente.
|
||||
.RE
|
||||
.PD 1
|
||||
.PP
|
||||
.RS
|
||||
.
|
||||
.TP
|
||||
.B controlli da mouse
|
||||
@ -2942,7 +2940,7 @@ driver di uscita audio PulseAudio
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs "[<host>][:<sink di uscita>]"
|
||||
specifica l'host e facoltativamente il sink di uscita da usare.
|
||||
Specifica l'host e facoltativamente il sink di uscita da usare.
|
||||
Una stringa <host> vuota usa una connessione locale, "localhost" usa
|
||||
un trasferimento via rete (molto probabilmente non è quello che vuoi).
|
||||
.RE
|
||||
@ -2987,6 +2985,22 @@ dispositivi disponibili.
|
||||
.PD 1
|
||||
.
|
||||
.TP
|
||||
.B kai (solo OS/2)
|
||||
driver di uscita video OS/2 KAI
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs uniaud
|
||||
Forza la modalità UNIAUD.
|
||||
.IPs dart
|
||||
Forza la modalità DART.
|
||||
.IPs (no)share
|
||||
Apre l'audio in modalità condivisa o esclusiva.
|
||||
.IPs bufsize=<dimensione>
|
||||
Imposta la dimensione del buffer a <dimensione> in campioni (default: 2048).
|
||||
.RE
|
||||
.PD 1
|
||||
.
|
||||
.TP
|
||||
.B dart (solo OS/2)
|
||||
driver di uscita video OS/2 DART
|
||||
.PD 0
|
||||
@ -3716,8 +3730,10 @@ Usa nochroma\-deint per usare solo la luminanza ed accellerare il
|
||||
deinterlacciamento avanzato.
|
||||
Utile con memoria video lenta.
|
||||
.IPs pullup
|
||||
Cerca di applicare il telecine inverso, richiede un deinterlacciamento
|
||||
temporale adattivo al movimento.
|
||||
Cerca di evitare il deinterlacciamento per i fotogrammi progressivi, utile per
|
||||
guardare contenuto in telecine, ha bisogno di hardware video veloce per alte
|
||||
risoluzioni.
|
||||
Funziona solo con un deinterlacciamento temporale adattivo al movimento.
|
||||
.IPs colorspace
|
||||
Seleziona lo spazio colore per la conversione da YUV a RGB (default: 1, BT.601).
|
||||
In linea di massima si dovrebbero usare BT.601 per contenuto con una
|
||||
@ -4030,8 +4046,9 @@ Nella maggior parte dei casi
|
||||
software verso RGB.
|
||||
.IPs yuv=<n>
|
||||
Seleziona il tipo di conversione da YUV a RGB.
|
||||
Il default è una selezione automatica tra i valori 0 e 2.
|
||||
.RSss
|
||||
0: Usa conversione software (default).
|
||||
0: Usa conversione software.
|
||||
Compatibile con tutte le versioni di OpenGL.
|
||||
Fornisce controllo di luminosità, contrasto e saturazione.
|
||||
.br
|
||||
@ -4715,7 +4732,7 @@ Specifica le opzioni avanzate dei filtri audio:
|
||||
.IPs force=<0\-7>
|
||||
Forza l'inserimento del filtro audio a uno dei seguenti:
|
||||
.RSss
|
||||
0: Inserimento completamente automatico dei filtri.
|
||||
0: Inserimento completamente automatico dei filtri (identico a 1 per ora).
|
||||
.br
|
||||
1: Ottimizza per la precisione (default).
|
||||
.br
|
||||
@ -6055,7 +6072,7 @@ Posizione dell'immagine da mantenere, il default
|
||||
.PD 1
|
||||
.
|
||||
.TP
|
||||
.B cropdetect[=limite:arrotondamento]
|
||||
.B cropdetect[=limite:arrotondamento[:azzeramento]]
|
||||
Calcola i parametri necessari per applicare automaticamente il filtro 'crop' e
|
||||
stampa i parametri raccomandati su stdout.
|
||||
.PD 0
|
||||
@ -6069,6 +6086,14 @@ Valore per cui devono essere divisibili i valori di larghezza/\:altezza (default
|
||||
Lo scostamento viene regolato automaticamente per centrare il video.
|
||||
Utilizza 2 per avere solo dimensioni pari (necessario per i filmati in formato 4:2:2).
|
||||
Con molti codec video conviene utilizzare 16 quando si effettua la codifica.
|
||||
.br
|
||||
.IPs <azzeramento>
|
||||
Contatore che determina il numero di fotogrammi dopo i quali cropdetect azzererà
|
||||
la più ampia area rilevata e ricomincerà a cercare la migliore superficie per
|
||||
il ritaglio (default: 0).
|
||||
Questo può tornare utile quando il logo di un canale falsa l'area del video.
|
||||
Un valore di 0 disattiva l'opzione e restituisce l'area più ampia rilevata
|
||||
durante la riproduzione.
|
||||
.RE
|
||||
.PD 1
|
||||
.
|
||||
@ -7403,11 +7428,11 @@ Altezza completa a met
|
||||
.
|
||||
.TP
|
||||
.B tfields[=modo[:posizione_campo]]
|
||||
Separazione temporale dei campi \- divide i campi in fotogrammi,
|
||||
raddoppiando il framerate di uscita.
|
||||
Come il filtro telecine, tfield lavorerà correttamente solo con
|
||||
MEncoder, e solo se entrambe le opzioni \-fps e \-ofps sono
|
||||
caricate al valore desiderato (doppio) del framerate.
|
||||
Separazione temporale dei campi \- divide i campi in fotogrammi, raddoppiando
|
||||
la frequenza dei fotogrammi (framerate) di uscita.
|
||||
Come il filtro telecine, tfields potrebbe lavorare in modo non corretto, tranne
|
||||
quando usato con MEncoder e con entrambe le opzioni \-fps e \-ofps impostate al
|
||||
valore desiderato (doppio) della frequenza fotogrammi.
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs <modo>
|
||||
@ -10554,17 +10579,17 @@ ma non azzerano il contatore "keyint".
|
||||
.
|
||||
.TP
|
||||
.B frameref=<1\-16>
|
||||
Numero di fotogrammi precedenti utilizzati come previsori nei fotogrammi
|
||||
B e P (default: 1).
|
||||
Numero di fotogrammi precedenti utilizzati come predittori nei fotogrammi B e P
|
||||
(default: 3).
|
||||
E' efficace con alcuni anime o cartoni animati, ma su filmati ripresi dal vivo
|
||||
i miglioramenti calano rapidamente dopo circa 6 fotogrammi di riferimento.
|
||||
Non ha effetto sulla velocità di decodifica ma incrementa la memoria necessaria
|
||||
alla decodifica.
|
||||
Alcuni decodificatori possono gestire un massimo di 15 fotogrammi di riferimento.
|
||||
Alcuni decodificatori possono gestire al massimo 15 fotogrammi di riferimento.
|
||||
.
|
||||
.TP
|
||||
.B bframes=<0\-16>
|
||||
Numero massimo di fotogrammi B consecutivi tra fotogrammi I e P (default: 0).
|
||||
numero massimo di fotogrammi B consecutivi tra fotogrammi I e P (default: 3)
|
||||
.
|
||||
.TP
|
||||
.B (no)b_adapt
|
||||
@ -10842,30 +10867,30 @@ Come 2, ma utilizza una rifinitura del quarto di pixel pi
|
||||
.IPs 4
|
||||
Esegue una stima del movimento a quarto di pixel rapida su tutti i tipi di
|
||||
macroblocchi candidati.
|
||||
Poi seleziona il tipo migliore.
|
||||
Poi seleziona il tipo migliore con una metrica SATD.
|
||||
Infine finisce la rifinitura a quarto di pixel per quel tipo.
|
||||
.IPs 5
|
||||
Esegue la miglior stima del movimento a quarto di pixel in tutti i
|
||||
tipi di macroblocchi candidati prima di selezionare il tipo migliore.
|
||||
tipi di macroblocco candidati prima di selezionare il tipo migliore.
|
||||
Inoltre rifinisce con una metrica SATD i due vettori di movimento usati nei
|
||||
macroblocchi bidirezionali, invece di riutilizzare i vettori delle ricerche
|
||||
in avanti e all'indietro.
|
||||
.IPs 6
|
||||
Abilita l'ottimizzazione rate-distorsion (?) dei tipi di macroblocco nei
|
||||
fotogrammi I e P (default).
|
||||
Abilita l'ottimizzazione rate-distorsion dei tipi di macroblocco nei
|
||||
fotogrammi I e P.
|
||||
.IPs 7
|
||||
Abilita l'ottimizzazione rate-distortion dei tipi di macroblocco in tutti i
|
||||
fotogrammi (qualità migliore).
|
||||
fotogrammi (default).
|
||||
.IPs 8
|
||||
Abilita l'ottimizzazione rate-distortion dei vettori di movimento nei
|
||||
fotogrammi I e P.
|
||||
Abilita l'ottimizzazione rate-distortion dei vettori di movimento e le modalità
|
||||
di previsione intra nei fotogrammi I e P.
|
||||
.IPs 9
|
||||
Abilita l'ottimizzazione rate-distortion dei vettori di movimento in tutti i
|
||||
fotogrammi (qualità migliore).
|
||||
Abilita l'ottimizzazione rate-distortion dei vettori di movimento e le modalità
|
||||
di previsione intra in tutti i fotogrammi (qualità migliore).
|
||||
.RE
|
||||
.PD 1
|
||||
.RS
|
||||
Sopra, 'tutti i tipi di macroblocco candidati' non indica esattamente tutti
|
||||
Sopra, "tutti i tipi di macroblocco candidati" non indica esattamente tutti
|
||||
i tipi abilitati: 4x4, 4x8, 8x4 vengono provati solo se 8x8 è migliore di
|
||||
16x16.
|
||||
.RE
|
||||
@ -10890,9 +10915,9 @@ quantizzazione ottimale della rate-distortion
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs 0
|
||||
disabilitata (default)
|
||||
disabilitata
|
||||
.IPs 1
|
||||
abilitata solo per la codifica finale
|
||||
abilitata solo per la codifica finale (default)
|
||||
.IPs 2
|
||||
abilitata durante ogni decisione di modalità (lento, richiede subq>=6)
|
||||
.RE
|
||||
@ -11047,8 +11072,8 @@ Utilizza questo parametro solo se sai cosa significa ed hai effettivamente
|
||||
bisogno di usarlo.
|
||||
.
|
||||
.TP
|
||||
.B threads=<1\-4>
|
||||
Genera diversi thread per codificare in parallelo su CPU multiple (default: 1).
|
||||
.B threads=<0\-16>
|
||||
Genera diversi thread per codificare in parallelo su CPU multiple (default: 0).
|
||||
Si ottiene una leggera penalizzazione della compressione.
|
||||
0 oppure 'auto' dicono a x264 di rilevare il numero delle CPU ed utilizzare un
|
||||
appropriato numero di thread.
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" sync with en/mplayer.1 rev. 30611
|
||||
.\" sync with en/mplayer.1 rev. 30677
|
||||
.\" Encoding: UTF-8
|
||||
.\" Reminder of hard terms which need better/final solution later:
|
||||
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
|
||||
@ -1446,6 +1446,9 @@ MPlayer 不阻止你装载产生于不同 AVI 的索引文件,
|
||||
.TP
|
||||
.B \-mc <每帧秒数>
|
||||
每帧的最大 A-V 同步修正(以秒为单位)。
|
||||
.br
|
||||
对于 mencoder,\-mc 0 应当总是与 \-noskip 一同使用,否则几乎必然导致音视频
|
||||
不同步。
|
||||
.
|
||||
.TP
|
||||
.B \-mf <选项1:选项2:...>
|
||||
|
@ -542,10 +542,11 @@ are not usable remotely because they are implemented at the demuxer level.
|
||||
|
||||
Be aware that currently the server is not secure at all.
|
||||
|
||||
Compile the server by running 'make TOOLS/netstream' from the root of mplayer
|
||||
source and then copy the netstream binary to the right place on your system
|
||||
(usually /usr/local/bin on Unix). Start the netstream server on the computer you
|
||||
intend to access remotely. There are no command line arguments.
|
||||
Compile the server by running 'make TOOLS/netstream' ('make TOOLS/netstream.exe'
|
||||
on windows) from the root of mplayer source and then copy the netstream binary
|
||||
to the right place on your system (usually /usr/local/bin on Unix). Start the
|
||||
netstream server on the computer you intend to access remotely. There are no
|
||||
command line arguments.
|
||||
|
||||
Play the second track of a VCD on the server with:
|
||||
|
||||
|
@ -104,7 +104,7 @@ int main(int argc, char **argv) {
|
||||
blit(fifo, image->pixels, image->w, image->h, i, i, 0, 1);
|
||||
|
||||
// Create a 75x75 bitmap
|
||||
bitmap = (unsigned char*)malloc(75*75*4);
|
||||
bitmap = malloc(75 * 75 * 4);
|
||||
|
||||
// Paint bitmap red, 50% transparent and blit at position 50,50
|
||||
paint(bitmap, (75*75*4), 255, 0, 0, 128);
|
||||
|
@ -72,7 +72,7 @@ static int save_settings(HDRVR hDriver, const char *filename)
|
||||
return -1;
|
||||
}
|
||||
|
||||
pv = (char *) malloc(cb);
|
||||
pv = malloc(cb);
|
||||
if (SendDriverMessage(hDriver, ICM_GETSTATE, (LPARAM) pv, (LPARAM) &cb) != ICERR_OK)
|
||||
{
|
||||
printf("ICM_GETSTATE failed\n");
|
||||
@ -112,7 +112,7 @@ static int load_settings(HDRVR hDriver, const char *filename)
|
||||
return -1;
|
||||
}
|
||||
|
||||
pv = (char *) malloc(info.st_size);
|
||||
pv = malloc(info.st_size);
|
||||
fd = fopen(filename, "rb");
|
||||
|
||||
if (!fd)
|
||||
|
2
ass_mp.c
2
ass_mp.c
@ -230,7 +230,7 @@ ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata,
|
||||
return track;
|
||||
}
|
||||
|
||||
ASS_Track *ass_read_stream(ASS_Library *library, char *fname, char *charset)
|
||||
ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, char *charset)
|
||||
{
|
||||
int i;
|
||||
char *buf = NULL;
|
||||
|
2
ass_mp.h
2
ass_mp.h
@ -48,7 +48,7 @@ ASS_Track *ass_default_track(ASS_Library *library);
|
||||
int ass_process_subtitle(ASS_Track *track, subtitle *sub);
|
||||
ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata,
|
||||
double fps);
|
||||
ASS_Track *ass_read_stream(ASS_Library *library, char *fname, char *charset);
|
||||
ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, char *charset);
|
||||
|
||||
void ass_configure(ASS_Renderer *priv, int w, int h, int hinting);
|
||||
void ass_configure_fonts(ASS_Renderer *priv);
|
||||
|
10
asxparser.c
10
asxparser.c
@ -42,7 +42,7 @@ asx_list_add(void* list_ptr,void* entry){
|
||||
if(list != NULL)
|
||||
for( ; list[c] != NULL; c++) ;
|
||||
|
||||
list = (void*)realloc(list,sizeof(void*)*(c+2));
|
||||
list = realloc(list, sizeof(void*) * (c + 2));
|
||||
|
||||
list[c] = entry;
|
||||
list[c+1] = NULL;
|
||||
@ -75,7 +75,7 @@ asx_list_remove(void* list_ptr,void* entry,ASX_FreeFunc free_func) {
|
||||
if(c > e) // If c==e the memmove is not needed
|
||||
memmove(list+e,list+e+1,(c-e)*sizeof(void*));
|
||||
|
||||
list = (void*)realloc(list,(c-1)*sizeof(void*));
|
||||
list = realloc(list, (c - 1) * sizeof(void*));
|
||||
list[c-1] = NULL;
|
||||
|
||||
*(void***)list_ptr = list;
|
||||
@ -186,7 +186,7 @@ asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs) {
|
||||
val[ptr2-ptr1] = '\0';
|
||||
n_attrib++;
|
||||
|
||||
attribs = (char**)realloc(attribs,(2*n_attrib+1)*sizeof(char*));
|
||||
attribs = realloc(attribs, (2 * n_attrib + 1) * sizeof(char*));
|
||||
attribs[n_attrib*2-2] = attrib;
|
||||
attribs[n_attrib*2-1] = val;
|
||||
|
||||
@ -241,7 +241,7 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
|
||||
memmove(parser->ret_stack,parser->ret_stack+i, (parser->ret_stack_size - i)*sizeof(ASX_LineSave_t));
|
||||
parser->ret_stack_size -= i;
|
||||
if(parser->ret_stack_size > 0)
|
||||
parser->ret_stack = (ASX_LineSave_t*)realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t));
|
||||
parser->ret_stack = realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t));
|
||||
else {
|
||||
free(parser->ret_stack);
|
||||
parser->ret_stack = NULL;
|
||||
@ -422,7 +422,7 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
|
||||
|
||||
parser->last_body = body;
|
||||
parser->ret_stack_size++;
|
||||
parser->ret_stack = (ASX_LineSave_t*)realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t));
|
||||
parser->ret_stack = realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t));
|
||||
if(parser->ret_stack_size > 1)
|
||||
memmove(parser->ret_stack+1,parser->ret_stack,(parser->ret_stack_size-1)*sizeof(ASX_LineSave_t));
|
||||
parser->ret_stack[0].buffer = ret;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Updated by: Roberto Togni <see AUTHORS for email address>
|
||||
// Updated by: PaulTT <see AUTHORS for email address>
|
||||
|
||||
// Updated to help_mp-en.h r30044
|
||||
// Updated to help_mp-en.h r30515
|
||||
|
||||
|
||||
// ========================= MPlayer help ===========================
|
||||
|
@ -291,7 +291,7 @@ int b_alive;
|
||||
}
|
||||
|
||||
/* Retrieve the name of the device. */
|
||||
psz_name = (char *)malloc(i_param_size);
|
||||
psz_name = malloc(i_param_size);
|
||||
err = AudioDeviceGetProperty(devid_def, 0, 0,
|
||||
kAudioDevicePropertyDeviceName,
|
||||
&i_param_size, psz_name);
|
||||
@ -513,7 +513,7 @@ static int OpenSPDIF(void)
|
||||
}
|
||||
|
||||
i_streams = i_param_size / sizeof(AudioStreamID);
|
||||
p_streams = (AudioStreamID *)malloc(i_param_size);
|
||||
p_streams = malloc(i_param_size);
|
||||
if (p_streams == NULL)
|
||||
{
|
||||
ao_msg(MSGT_AO, MSGL_WARN, "out of memory\n" );
|
||||
@ -549,7 +549,7 @@ static int OpenSPDIF(void)
|
||||
}
|
||||
|
||||
i_formats = i_param_size / sizeof(AudioStreamBasicDescription);
|
||||
p_format_list = (AudioStreamBasicDescription *)malloc(i_param_size);
|
||||
p_format_list = malloc(i_param_size);
|
||||
if (p_format_list == NULL)
|
||||
{
|
||||
ao_msg(MSGT_AO, MSGL_WARN, "could not malloc the memory\n" );
|
||||
@ -742,7 +742,7 @@ static int AudioDeviceSupportsDigital( AudioDeviceID i_dev_id )
|
||||
}
|
||||
|
||||
i_streams = i_param_size / sizeof(AudioStreamID);
|
||||
p_streams = (AudioStreamID *)malloc(i_param_size);
|
||||
p_streams = malloc(i_param_size);
|
||||
if (p_streams == NULL)
|
||||
{
|
||||
ao_msg(MSGT_AO,MSGL_V, "out of memory\n");
|
||||
@ -791,7 +791,7 @@ static int AudioStreamSupportsDigital( AudioStreamID i_stream_id )
|
||||
}
|
||||
|
||||
i_formats = i_param_size / sizeof(AudioStreamBasicDescription);
|
||||
p_format_list = (AudioStreamBasicDescription *)malloc(i_param_size);
|
||||
p_format_list = malloc(i_param_size);
|
||||
if (p_format_list == NULL)
|
||||
{
|
||||
ao_msg(MSGT_AO,MSGL_V, "could not malloc the memory\n" );
|
||||
|
@ -192,7 +192,7 @@ static char **get_extensions(menu_t *menu){
|
||||
if(!fp)
|
||||
return NULL;
|
||||
|
||||
extensions = (char **) malloc(sizeof(*extensions));
|
||||
extensions = malloc(sizeof(*extensions));
|
||||
*extensions = NULL;
|
||||
|
||||
while(fgets(ext,sizeof(ext),fp)) {
|
||||
@ -203,9 +203,9 @@ static char **get_extensions(menu_t *menu){
|
||||
ext[s-1] = '\0';
|
||||
s--;
|
||||
}
|
||||
e = (char *) malloc(s+1);
|
||||
extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
|
||||
extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
|
||||
e = malloc(s+1);
|
||||
extensions = realloc(extensions, ++n * sizeof(*extensions));
|
||||
extensions = realloc(extensions, ++n * sizeof(*extensions));
|
||||
strcpy (e, ext);
|
||||
for (l=extensions; *l; l++);
|
||||
*l++ = e;
|
||||
@ -261,7 +261,7 @@ static int open_dir(menu_t* menu,char* args) {
|
||||
}
|
||||
}
|
||||
|
||||
namelist = (char **) malloc(sizeof(char *));
|
||||
namelist = malloc(sizeof(char *));
|
||||
extensions = get_extensions(menu);
|
||||
|
||||
n=0;
|
||||
@ -289,7 +289,7 @@ static int open_dir(menu_t* menu,char* args) {
|
||||
continue;
|
||||
}
|
||||
if(n%20 == 0){ // Get some more mem
|
||||
if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *)))
|
||||
if((tp = realloc(namelist, (n+20) * sizeof (char *)))
|
||||
== NULL) {
|
||||
mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] realloc error: %s\n", strerror(errno));
|
||||
n--;
|
||||
@ -298,7 +298,7 @@ static int open_dir(menu_t* menu,char* args) {
|
||||
namelist=tp;
|
||||
}
|
||||
|
||||
namelist[n] = (char *) malloc(strlen(dp->d_name) + 2);
|
||||
namelist[n] = malloc(strlen(dp->d_name) + 2);
|
||||
if(namelist[n] == NULL){
|
||||
mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] memory allocation error: %s\n", strerror(errno));
|
||||
n--;
|
||||
|
@ -52,7 +52,7 @@ typedef struct mad_decoder_s {
|
||||
|
||||
static int preinit(sh_audio_t *sh){
|
||||
|
||||
mad_decoder_t *this = (mad_decoder_t *) malloc(sizeof(mad_decoder_t));
|
||||
mad_decoder_t *this = malloc(sizeof(mad_decoder_t));
|
||||
memset(this,0,sizeof(mad_decoder_t));
|
||||
sh->context = this;
|
||||
|
||||
|
@ -59,7 +59,7 @@ audio_encoder_t *new_audio_encoder(muxer_stream_t *stream, audio_encoding_params
|
||||
if(! params)
|
||||
return NULL;
|
||||
|
||||
encoder = (audio_encoder_t *) calloc(1, sizeof(audio_encoder_t));
|
||||
encoder = calloc(1, sizeof(audio_encoder_t));
|
||||
memcpy(&encoder->params, params, sizeof(audio_encoding_params_t));
|
||||
encoder->stream = stream;
|
||||
|
||||
|
@ -165,7 +165,7 @@ int mpae_init_toolame(audio_encoder_t *encoder)
|
||||
else
|
||||
mp_msg(MSGT_MENCODER, MSGL_ERR, "ae_toolame, Toolame can't encode > 2 channels, exiting\n");
|
||||
|
||||
ctx = (mpae_toolame_ctx *) calloc(1, sizeof(mpae_toolame_ctx));
|
||||
ctx = calloc(1, sizeof(mpae_toolame_ctx));
|
||||
if(ctx == NULL)
|
||||
{
|
||||
mp_msg(MSGT_MENCODER, MSGL_ERR, "ae_toolame, couldn't alloc a %d bytes context, exiting\n", sizeof(mpae_toolame_ctx));
|
||||
|
@ -209,7 +209,7 @@ static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
|
||||
#endif
|
||||
|
||||
static inline mp_image_t* new_mp_image(int w,int h){
|
||||
mp_image_t* mpi=(mp_image_t*)malloc(sizeof(mp_image_t));
|
||||
mp_image_t* mpi = malloc(sizeof(mp_image_t));
|
||||
if(!mpi) return NULL; // error!
|
||||
memset(mpi,0,sizeof(mp_image_t));
|
||||
mpi->width=mpi->w=w;
|
||||
|
@ -162,7 +162,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
|
||||
if (out_fmt==IMGFMT_BGR8) {
|
||||
png_get_PLTE( png,info,&pal,&cols );
|
||||
mpi->planes[1] = (char*)realloc(mpi->planes[1], 4*cols);
|
||||
mpi->planes[1] = realloc(mpi->planes[1], 4*cols);
|
||||
p = mpi->planes[1];
|
||||
for (i = 0; i < cols; i++) {
|
||||
*p++ = pal[i].blue;
|
||||
|
@ -92,7 +92,7 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...)
|
||||
/* init driver */
|
||||
static int init(sh_video_t *sh)
|
||||
{
|
||||
sh->context = (TGAInfo *) calloc(1, sizeof(TGAInfo));
|
||||
sh->context = calloc(1, sizeof(TGAInfo));
|
||||
last_w = -1;
|
||||
|
||||
return 1;
|
||||
|
@ -84,7 +84,7 @@ control(sh_video_t* sh, int cmd, void *arg, ...)
|
||||
static int
|
||||
init(sh_video_t *sh)
|
||||
{
|
||||
sh->context = (SGIInfo *) calloc(1, sizeof(SGIInfo));
|
||||
sh->context = calloc(1, sizeof(SGIInfo));
|
||||
last_x = -1;
|
||||
|
||||
return 1;
|
||||
|
@ -139,7 +139,7 @@ mp_msg(MSGT_WIN32,MSGL_INFO,"\n");
|
||||
mp_msg(MSGT_WIN32,MSGL_ERR,"Cannot open Compressor data file!\n");
|
||||
return NULL;
|
||||
}
|
||||
drvdata = (char *) malloc(st.st_size);
|
||||
drvdata = malloc(st.st_size);
|
||||
if (fread(drvdata, st.st_size, 1, fd) != 1) {
|
||||
mp_msg(MSGT_WIN32,MSGL_ERR,"Cannot read Compressor data file!\n");
|
||||
fclose(fd);
|
||||
|
@ -255,11 +255,11 @@ int put_image (vf_instance_t *vf, mp_image_t *src, double pts)
|
||||
img_n = eq2->buf_w[0]*eq2->buf_h[0];
|
||||
if(src->num_planes>1){
|
||||
img_c = eq2->buf_w[1]*eq2->buf_h[1];
|
||||
eq2->buf[0] = (unsigned char *) realloc (eq2->buf[0], img_n + 2*img_c);
|
||||
eq2->buf[0] = realloc (eq2->buf[0], img_n + 2*img_c);
|
||||
eq2->buf[1] = eq2->buf[0] + img_n;
|
||||
eq2->buf[2] = eq2->buf[1] + img_c;
|
||||
} else
|
||||
eq2->buf[0] = (unsigned char *) realloc (eq2->buf[0], img_n);
|
||||
eq2->buf[0] = realloc (eq2->buf[0], img_n);
|
||||
}
|
||||
|
||||
dst = vf_get_image (vf->next, src->imgfmt, MP_IMGTYPE_EXPORT, 0, src->w, src->h);
|
||||
@ -457,7 +457,7 @@ int vf_open(vf_instance_t *vf, char *args)
|
||||
vf->put_image = put_image;
|
||||
vf->uninit = uninit;
|
||||
|
||||
vf->priv = (vf_eq2_t *) malloc (sizeof (vf_eq2_t));
|
||||
vf->priv = malloc (sizeof (vf_eq2_t));
|
||||
eq2 = vf->priv;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
@ -47,7 +47,7 @@ static int demux_aac_init(demuxer_t *demuxer)
|
||||
if(!priv)
|
||||
return 0;
|
||||
|
||||
priv->buf = (uint8_t*) malloc(8);
|
||||
priv->buf = malloc(8);
|
||||
if(!priv->buf)
|
||||
{
|
||||
free(priv);
|
||||
|
@ -1252,7 +1252,7 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) {
|
||||
demux_packet_t *dp;
|
||||
sh_audio_t *sh_audio = demuxer->audio->sh;
|
||||
int np;
|
||||
uint8_t *extradata = sh_audio->wf + 1;
|
||||
uint8_t *extradata = (uint8_t *)(sh_audio->wf + 1);
|
||||
int i;
|
||||
unsigned char *p = NULL,*buf;
|
||||
int plen;
|
||||
|
@ -191,7 +191,7 @@ static demuxer_t* demux_open_roq(demuxer_t* demuxer)
|
||||
}
|
||||
|
||||
// index the chunk
|
||||
roq_data->chunks = (roq_chunk_t *)realloc(roq_data->chunks,
|
||||
roq_data->chunks = realloc(roq_data->chunks,
|
||||
(roq_data->total_chunks + 1) * sizeof (roq_chunk_t));
|
||||
roq_data->chunks[roq_data->total_chunks].chunk_type = CHUNK_TYPE_AUDIO;
|
||||
roq_data->chunks[roq_data->total_chunks].chunk_offset =
|
||||
@ -214,7 +214,7 @@ static demuxer_t* demux_open_roq(demuxer_t* demuxer)
|
||||
{
|
||||
// index a new chunk if it's a codebook or quad VQ not following a
|
||||
// codebook
|
||||
roq_data->chunks = (roq_chunk_t *)realloc(roq_data->chunks,
|
||||
roq_data->chunks = realloc(roq_data->chunks,
|
||||
(roq_data->total_chunks + 1) * sizeof (roq_chunk_t));
|
||||
roq_data->chunks[roq_data->total_chunks].chunk_type = CHUNK_TYPE_VIDEO;
|
||||
roq_data->chunks[roq_data->total_chunks].chunk_offset =
|
||||
|
@ -320,7 +320,7 @@ static void ts_add_stream(demuxer_t * demuxer, ES_stream_t *es)
|
||||
|
||||
if(es->extradata && es->extradata_len)
|
||||
{
|
||||
sh->wf = (WAVEFORMATEX *) malloc(sizeof (WAVEFORMATEX) + es->extradata_len);
|
||||
sh->wf = malloc(sizeof (WAVEFORMATEX) + es->extradata_len);
|
||||
sh->wf->cbSize = es->extradata_len;
|
||||
memcpy(sh->wf + 1, es->extradata, es->extradata_len);
|
||||
}
|
||||
@ -344,7 +344,7 @@ static void ts_add_stream(demuxer_t * demuxer, ES_stream_t *es)
|
||||
if(sh->format == VIDEO_AVC && es->extradata && es->extradata_len)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
sh->bih = (BITMAPINFOHEADER *) calloc(1, sizeof(BITMAPINFOHEADER) + es->extradata_len);
|
||||
sh->bih = calloc(1, sizeof(BITMAPINFOHEADER) + es->extradata_len);
|
||||
sh->bih->biSize= sizeof(BITMAPINFOHEADER) + es->extradata_len;
|
||||
sh->bih->biCompression = sh->format;
|
||||
memcpy(sh->bih + 1, es->extradata, es->extradata_len);
|
||||
@ -680,7 +680,7 @@ static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param)
|
||||
pptr = &pes_priv1[es.pid];
|
||||
if(pptr->pos < 64*1024)
|
||||
{
|
||||
tmpbuf = (char*) realloc(pptr->buf, pptr->pos + es.size);
|
||||
tmpbuf = realloc(pptr->buf, pptr->pos + es.size);
|
||||
if(tmpbuf != NULL)
|
||||
{
|
||||
pptr->buf = tmpbuf;
|
||||
@ -1678,7 +1678,7 @@ static int collect_section(ts_section_t *section, int is_start, unsigned char *b
|
||||
{
|
||||
if(! section->buffer)
|
||||
{
|
||||
section->buffer = (uint8_t*) malloc(4096+256);
|
||||
section->buffer = malloc(4096 + 256);
|
||||
if(section->buffer == NULL)
|
||||
return 0;
|
||||
}
|
||||
@ -2697,7 +2697,7 @@ static int fill_extradata(mp4_decoder_config_t * mp4_dec, ES_stream_t *tss)
|
||||
|
||||
if(mp4_dec->buf_size > tss->extradata_alloc)
|
||||
{
|
||||
tmp = (uint8_t *) realloc(tss->extradata, mp4_dec->buf_size);
|
||||
tmp = realloc(tss->extradata, mp4_dec->buf_size);
|
||||
if(!tmp)
|
||||
return 0;
|
||||
tss->extradata = tmp;
|
||||
|
@ -1301,8 +1301,7 @@ int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param)
|
||||
}
|
||||
}
|
||||
|
||||
info = demuxer->info =
|
||||
(char **) realloc(info, (2 * (n + 2)) * sizeof(char *));
|
||||
info = demuxer->info = realloc(info, (2 * (n + 2)) * sizeof(char *));
|
||||
info[2 * n] = strdup(opt);
|
||||
info[2 * n + 1] = strdup(param);
|
||||
memset(&info[2 * (n + 1)], 0, 2 * sizeof(char *));
|
||||
|
@ -279,7 +279,7 @@ typedef struct {
|
||||
} demux_program_t;
|
||||
|
||||
static inline demux_packet_t* new_demux_packet(int len){
|
||||
demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
|
||||
demux_packet_t* dp = malloc(sizeof(demux_packet_t));
|
||||
dp->len=len;
|
||||
dp->next=NULL;
|
||||
dp->pts=MP_NOPTS_VALUE;
|
||||
@ -290,7 +290,7 @@ static inline demux_packet_t* new_demux_packet(int len){
|
||||
dp->refcount=1;
|
||||
dp->master=NULL;
|
||||
dp->buffer=NULL;
|
||||
if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + MP_INPUT_BUFFER_PADDING_SIZE)))
|
||||
if (len > 0 && (dp->buffer = malloc(len + MP_INPUT_BUFFER_PADDING_SIZE)))
|
||||
memset(dp->buffer + len, 0, 8);
|
||||
else
|
||||
dp->len = 0;
|
||||
@ -301,7 +301,7 @@ static inline void resize_demux_packet(demux_packet_t* dp, int len)
|
||||
{
|
||||
if(len > 0)
|
||||
{
|
||||
dp->buffer=(unsigned char *)realloc(dp->buffer,len+8);
|
||||
dp->buffer = realloc(dp->buffer, len + 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -316,7 +316,7 @@ static inline void resize_demux_packet(demux_packet_t* dp, int len)
|
||||
}
|
||||
|
||||
static inline demux_packet_t* clone_demux_packet(demux_packet_t* pack){
|
||||
demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
|
||||
demux_packet_t* dp = malloc(sizeof(demux_packet_t));
|
||||
while(pack->master) pack=pack->master; // find the master
|
||||
memcpy(dp,pack,sizeof(demux_packet_t));
|
||||
dp->next=NULL;
|
||||
|
@ -225,7 +225,7 @@ char *ebml_read_ascii(stream_t *s, uint64_t *length)
|
||||
if (length)
|
||||
*length = len + l;
|
||||
|
||||
str = (char *) malloc(len + 1);
|
||||
str = malloc(len + 1);
|
||||
if (stream_read(s, str, len) != (int) len) {
|
||||
free(str);
|
||||
return NULL;
|
||||
|
@ -340,7 +340,7 @@ int muxer_init_muxer_lavf(muxer_t *muxer)
|
||||
"will play these INCORRECT files as if nothing were wrong!\n"
|
||||
"*******************************************************************************\n");
|
||||
|
||||
priv = (muxer_priv_t *) calloc(1, sizeof(muxer_priv_t));
|
||||
priv = calloc(1, sizeof(muxer_priv_t));
|
||||
if(priv == NULL)
|
||||
return 0;
|
||||
|
||||
|
@ -339,13 +339,13 @@ static mpeg_frame_t *init_frames(uint16_t num, size_t size)
|
||||
mpeg_frame_t *tmp;
|
||||
uint16_t i;
|
||||
|
||||
tmp = (mpeg_frame_t *) calloc(num, sizeof(mpeg_frame_t));
|
||||
tmp = calloc(num, sizeof(mpeg_frame_t));
|
||||
if(tmp == NULL)
|
||||
return NULL;
|
||||
|
||||
for(i=0; i < num; i++)
|
||||
{
|
||||
tmp[i].buffer = (uint8_t *) calloc(1, size);
|
||||
tmp[i].buffer = calloc(1, size);
|
||||
if(tmp[i].buffer == NULL)
|
||||
return NULL;
|
||||
tmp[i].size = 0;
|
||||
@ -386,14 +386,14 @@ static muxer_stream_t* mpegfile_new_stream(muxer_t *muxer,int type){
|
||||
mp_msg(MSGT_MUXER, MSGL_ERR, "Unknown stream type!\n");
|
||||
return NULL;
|
||||
}
|
||||
s = (muxer_stream_t*) calloc(1, sizeof(muxer_stream_t));
|
||||
s = calloc(1, sizeof(muxer_stream_t));
|
||||
if(!s) return NULL; // no mem!?
|
||||
if (!(s->b_buffer = malloc(priv->packet_size)))
|
||||
goto init_fail;
|
||||
s->b_buffer_size = priv->packet_size;
|
||||
s->b_buffer_ptr = 0;
|
||||
s->b_buffer_len = 0;
|
||||
s->priv = (muxer_headers_t*) calloc(1, sizeof(muxer_headers_t));
|
||||
s->priv = calloc(1, sizeof(muxer_headers_t));
|
||||
if(s->priv == NULL)
|
||||
goto init_fail;
|
||||
spriv = (muxer_headers_t *) s->priv;
|
||||
@ -1964,7 +1964,7 @@ static int fill_last_frame(muxer_headers_t *spriv, uint8_t *ptr, int len)
|
||||
{
|
||||
if(spriv->framebuf[idx].size > SIZE_MAX - (size_t)len)
|
||||
return 0;
|
||||
spriv->framebuf[idx].buffer = (uint8_t*) realloc(spriv->framebuf[idx].buffer, spriv->framebuf[idx].size + len);
|
||||
spriv->framebuf[idx].buffer = realloc(spriv->framebuf[idx].buffer, spriv->framebuf[idx].size + len);
|
||||
if(! spriv->framebuf[idx].buffer)
|
||||
return 0;
|
||||
spriv->framebuf[idx].alloc_size = spriv->framebuf[idx].size + len;
|
||||
@ -1983,7 +1983,7 @@ static int add_frame(muxer_headers_t *spriv, uint64_t idur, uint8_t *ptr, int le
|
||||
idx = spriv->framebuf_used;
|
||||
if(idx >= spriv->framebuf_cnt)
|
||||
{
|
||||
spriv->framebuf = (mpeg_frame_t*) realloc_struct(spriv->framebuf, (spriv->framebuf_cnt+1), sizeof(mpeg_frame_t));
|
||||
spriv->framebuf = realloc_struct(spriv->framebuf, (spriv->framebuf_cnt+1), sizeof(mpeg_frame_t));
|
||||
if(spriv->framebuf == NULL)
|
||||
{
|
||||
mp_msg(MSGT_MUXER, MSGL_FATAL, "Couldn't realloc frame buffer(idx), abort\n");
|
||||
@ -1994,7 +1994,7 @@ static int add_frame(muxer_headers_t *spriv, uint64_t idur, uint8_t *ptr, int le
|
||||
spriv->framebuf[spriv->framebuf_cnt].alloc_size = 0;
|
||||
spriv->framebuf[spriv->framebuf_cnt].pos = 0;
|
||||
|
||||
spriv->framebuf[spriv->framebuf_cnt].buffer = (uint8_t*) malloc(len);
|
||||
spriv->framebuf[spriv->framebuf_cnt].buffer = malloc(len);
|
||||
if(spriv->framebuf[spriv->framebuf_cnt].buffer == NULL)
|
||||
{
|
||||
mp_msg(MSGT_MUXER, MSGL_FATAL, "Couldn't realloc frame buffer(frame), abort\n");
|
||||
@ -2500,7 +2500,7 @@ static void generate_flags(uint8_t *bff_mask, int source, int target)
|
||||
int muxer_init_muxer_mpeg(muxer_t *muxer)
|
||||
{
|
||||
muxer_priv_t *priv;
|
||||
priv = (muxer_priv_t *) calloc(1, sizeof(muxer_priv_t));
|
||||
priv = calloc(1, sizeof(muxer_priv_t));
|
||||
if(priv == NULL)
|
||||
return 0;
|
||||
priv->update_system_header = 1;
|
||||
@ -2716,7 +2716,7 @@ int muxer_init_muxer_mpeg(muxer_t *muxer)
|
||||
|
||||
priv->drop = conf_drop;
|
||||
|
||||
priv->buff = (uint8_t *) malloc(priv->packet_size);
|
||||
priv->buff = malloc(priv->packet_size);
|
||||
if((priv->buff == NULL))
|
||||
{
|
||||
mp_msg(MSGT_MUXER, MSGL_ERR, "\nCouldn't allocate %d bytes, exit\n", priv->packet_size);
|
||||
|
@ -382,7 +382,7 @@ mpeg_header_parser:
|
||||
}
|
||||
|
||||
if(mp_vc1_decode_sequence_header(&picture, &videobuffer[4], videobuf_len-4)) {
|
||||
sh_video->bih = (BITMAPINFOHEADER *) calloc(1, sizeof(BITMAPINFOHEADER) + videobuf_len);
|
||||
sh_video->bih = calloc(1, sizeof(BITMAPINFOHEADER) + videobuf_len);
|
||||
if(sh_video->bih == NULL) {
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't alloc %d bytes for VC-1 extradata!\n", sizeof(BITMAPINFOHEADER) + videobuf_len);
|
||||
return 0;
|
||||
|
12
libvo/sub.c
12
libvo/sub.c
@ -730,7 +730,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
render_one_glyph(sub_font, c);
|
||||
|
||||
if (c == ' ') {
|
||||
struct osd_text_t *tmp_ott = (struct osd_text_t *) calloc(1, sizeof(struct osd_text_t));
|
||||
struct osd_text_t *tmp_ott = calloc(1, sizeof(struct osd_text_t));
|
||||
|
||||
if (osl == NULL) {
|
||||
osl = cp_ott = tmp_ott;
|
||||
@ -743,7 +743,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
}
|
||||
tmp_ott->osd_length = xsize;
|
||||
tmp_ott->text_length = char_position;
|
||||
tmp_ott->text = (int *) malloc(char_position * sizeof(int));
|
||||
tmp_ott->text = malloc(char_position * sizeof(int));
|
||||
for (counter = 0; counter < char_position; ++counter)
|
||||
tmp_ott->text[counter] = char_seq[counter];
|
||||
char_position = 0;
|
||||
@ -773,7 +773,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
|
||||
// osl holds an ordered (as they appear in the lines) chain of the subtitle words
|
||||
{
|
||||
struct osd_text_t *tmp_ott = (struct osd_text_t *) calloc(1, sizeof(struct osd_text_t));
|
||||
struct osd_text_t *tmp_ott = calloc(1, sizeof(struct osd_text_t));
|
||||
|
||||
if (osl == NULL) {
|
||||
osl = cp_ott = tmp_ott;
|
||||
@ -786,7 +786,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
}
|
||||
tmp_ott->osd_length = xsize;
|
||||
tmp_ott->text_length = char_position;
|
||||
tmp_ott->text = (int *) malloc(char_position * sizeof(int));
|
||||
tmp_ott->text = malloc(char_position * sizeof(int));
|
||||
for (counter = 0; counter < char_position; ++counter)
|
||||
tmp_ott->text[counter] = char_seq[counter];
|
||||
char_position = 0;
|
||||
@ -798,7 +798,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
int value = 0, exit = 0, minimum = 0;
|
||||
|
||||
// otp will contain the chain of the osd subtitle lines coming from the single vo_sub line.
|
||||
otp = tmp_otp = (struct osd_text_p *) calloc(1, sizeof(struct osd_text_p));
|
||||
otp = tmp_otp = calloc(1, sizeof(struct osd_text_p));
|
||||
tmp_otp->ott = osl;
|
||||
for (tmp_ott = tmp_otp->ott; exit == 0; ) {
|
||||
do {
|
||||
@ -806,7 +806,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
|
||||
tmp_ott = tmp_ott->next;
|
||||
} while ((tmp_ott != NULL) && (value + tmp_ott->osd_kerning + tmp_ott->osd_length <= xlimit));
|
||||
if (tmp_ott != NULL) {
|
||||
struct osd_text_p *tmp = (struct osd_text_p *) calloc(1, sizeof(struct osd_text_p));
|
||||
struct osd_text_p *tmp = calloc(1, sizeof(struct osd_text_p));
|
||||
|
||||
tmp_otp->value = value;
|
||||
tmp_otp->next = tmp;
|
||||
|
@ -177,17 +177,16 @@ const struct vo_driver *video_out_drivers[] =
|
||||
#ifdef CONFIG_XV
|
||||
&video_out_xv,
|
||||
#endif
|
||||
#ifdef CONFIG_GL
|
||||
&video_out_gl,
|
||||
#endif
|
||||
#ifdef CONFIG_X11
|
||||
&video_out_x11,
|
||||
&video_out_xover,
|
||||
#endif
|
||||
#ifdef CONFIG_GL
|
||||
&video_out_gl,
|
||||
&video_out_gl2,
|
||||
#endif
|
||||
#ifdef CONFIG_MATRIXVIEW
|
||||
&video_out_matrixview,
|
||||
#endif
|
||||
#ifdef CONFIG_DGA
|
||||
&video_out_dga,
|
||||
#endif
|
||||
@ -204,6 +203,9 @@ const struct vo_driver *video_out_drivers[] =
|
||||
#ifdef CONFIG_SVGALIB
|
||||
&video_out_svga,
|
||||
#endif
|
||||
#ifdef CONFIG_MATRIXVIEW
|
||||
&video_out_matrixview,
|
||||
#endif
|
||||
#ifdef CONFIG_AA
|
||||
&video_out_aa,
|
||||
#endif
|
||||
@ -590,7 +592,7 @@ range_t *str2range(char *s)
|
||||
for (i = 0; *endptr; i++) {
|
||||
if (*s == ',')
|
||||
goto out_err;
|
||||
if (!(r = (range_t *) realloc(r, sizeof(*r) * (i + 2)))) {
|
||||
if (!(r = realloc(r, sizeof(*r) * (i + 2)))) {
|
||||
mp_msg(MSGT_GLOBAL, MSGL_WARN,"can't realloc 'r'\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
( (out_height - in_height) / 2 ) * fb_line_len;
|
||||
|
||||
#ifndef USE_CONVERT2FB
|
||||
if (!(next_frame = (uint8_t *) realloc(next_frame, in_width * in_height * fb_pixel_size))) {
|
||||
if (!(next_frame = realloc(next_frame, in_width * in_height * fb_pixel_size))) {
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't malloc next_frame: %s\n", strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
@ -69,12 +69,12 @@ IMPLEMENT_IUNKNOWN(CMediaBuffer)
|
||||
CMediaBuffer* CMediaBufferCreate(unsigned long maxlen, void* mem,
|
||||
unsigned long len, int copy)
|
||||
{
|
||||
CMediaBuffer* This = (CMediaBuffer*) malloc(sizeof(CMediaBuffer));
|
||||
CMediaBuffer* This = malloc(sizeof(CMediaBuffer));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
|
||||
This->vt = (IMediaBuffer_vt*) malloc(sizeof(IMediaBuffer_vt));
|
||||
This->vt = malloc(sizeof(IMediaBuffer_vt));
|
||||
if (!This->vt)
|
||||
{
|
||||
CMediaBuffer_Destroy(This);
|
||||
|
@ -36,7 +36,7 @@ DMO_Filter* DMO_FilterCreate(const char* dllname, const GUID* id,
|
||||
{
|
||||
HRESULT hr = 0;
|
||||
const char* em = NULL;
|
||||
DMO_Filter* This = (DMO_Filter*) malloc(sizeof(DMO_Filter));
|
||||
DMO_Filter* This = malloc(sizeof(DMO_Filter));
|
||||
if (!This)
|
||||
return NULL;
|
||||
|
||||
|
@ -75,7 +75,7 @@ void SetCodecPath(const char* path)
|
||||
needs_free=0;
|
||||
return;
|
||||
}
|
||||
def_path = (char*) malloc(strlen(path)+1);
|
||||
def_path = malloc(strlen(path)+1);
|
||||
strcpy(def_path, path);
|
||||
needs_free=1;
|
||||
}
|
||||
@ -153,7 +153,7 @@ HDRVR DrvOpen(LPARAM lParam2)
|
||||
#endif
|
||||
printf("Loading codec DLL: '%s'\n",filename);
|
||||
|
||||
hDriver = (NPDRVR) malloc(sizeof(DRVR));
|
||||
hDriver = malloc(sizeof(DRVR));
|
||||
if (!hDriver)
|
||||
return (HDRVR) 0;
|
||||
memset((void*)hDriver, 0, sizeof(DRVR));
|
||||
|
@ -58,7 +58,7 @@ static inline int avm_list_print(avm_list_t* head)
|
||||
|
||||
static inline avm_list_t* avm_list_add_head(avm_list_t* head, void* member)
|
||||
{
|
||||
avm_list_t* n = (avm_list_t*) malloc(sizeof(avm_list_t));
|
||||
avm_list_t* n = malloc(sizeof(avm_list_t));
|
||||
n->member = member;
|
||||
|
||||
if (!head)
|
||||
@ -310,7 +310,7 @@ IMPLEMENT_IUNKNOWN(MemAllocator)
|
||||
|
||||
MemAllocator* MemAllocatorCreate()
|
||||
{
|
||||
MemAllocator* This = (MemAllocator*) malloc(sizeof(MemAllocator));
|
||||
MemAllocator* This = malloc(sizeof(MemAllocator));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -323,7 +323,7 @@ MemAllocator* MemAllocatorCreate()
|
||||
This->props.cbAlign = 1;
|
||||
This->props.cbPrefix = 0;
|
||||
|
||||
This->vt = (IMemAllocator_vt*) malloc(sizeof(IMemAllocator_vt));
|
||||
This->vt = malloc(sizeof(IMemAllocator_vt));
|
||||
|
||||
if (!This->vt)
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ static HRESULT STDCALL CMediaSample_SetActualDataLength(IMediaSample* This,
|
||||
char* c = cms->own_block;
|
||||
Debug printf("CMediaSample - buffer overflow %ld %d %p %p\n",
|
||||
__MIDL_0010, ((CMediaSample*)This)->size, cms->own_block, cms->block);
|
||||
cms->own_block = (char*) realloc(cms->own_block, (size_t) __MIDL_0010 + SAFETY_ACEL);
|
||||
cms->own_block = realloc(cms->own_block, (size_t) __MIDL_0010 + SAFETY_ACEL);
|
||||
if (c == cms->block)
|
||||
cms->block = cms->own_block;
|
||||
cms->size = __MIDL_0010;
|
||||
@ -510,7 +510,7 @@ static void CMediaSample_ResetPointer(CMediaSample* This)
|
||||
*/
|
||||
CMediaSample* CMediaSampleCreate(IMemAllocator* allocator, int size)
|
||||
{
|
||||
CMediaSample* This = (CMediaSample*) malloc(sizeof(CMediaSample));
|
||||
CMediaSample* This = malloc(sizeof(CMediaSample));
|
||||
if (!This)
|
||||
return NULL;
|
||||
|
||||
@ -524,8 +524,8 @@ CMediaSample* CMediaSampleCreate(IMemAllocator* allocator, int size)
|
||||
//if (size < 0x1000)
|
||||
// size = (size + 0xfff) & ~0xfff;
|
||||
|
||||
This->vt = (IMediaSample_vt*) malloc(sizeof(IMediaSample_vt));
|
||||
This->own_block = (char*) malloc((size_t)size + SAFETY_ACEL);
|
||||
This->vt = malloc(sizeof(IMediaSample_vt));
|
||||
This->own_block = malloc((size_t)size + SAFETY_ACEL);
|
||||
This->media_type.pbFormat = 0;
|
||||
This->media_type.pUnk = 0;
|
||||
|
||||
|
@ -167,7 +167,7 @@ IMPLEMENT_IUNKNOWN(CEnumPins)
|
||||
*/
|
||||
static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp)
|
||||
{
|
||||
CEnumPins* This = (CEnumPins*) malloc(sizeof(CEnumPins));
|
||||
CEnumPins* This = malloc(sizeof(CEnumPins));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -177,7 +177,7 @@ static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp)
|
||||
This->pin2 = pp;
|
||||
This->counter = 0;
|
||||
|
||||
This->vt = (IEnumPins_vt*) malloc(sizeof(IEnumPins_vt));
|
||||
This->vt = malloc(sizeof(IEnumPins_vt));
|
||||
if (!This->vt)
|
||||
{
|
||||
free(This);
|
||||
@ -539,7 +539,7 @@ IMPLEMENT_IUNKNOWN(CInputPin)
|
||||
*/
|
||||
CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
|
||||
{
|
||||
CInputPin* This = (CInputPin*) malloc(sizeof(CInputPin));
|
||||
CInputPin* This = malloc(sizeof(CInputPin));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -548,7 +548,7 @@ CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
|
||||
This->parent = p;
|
||||
CopyMediaType(&(This->type),amt);
|
||||
|
||||
This->vt= (IPin_vt*) malloc(sizeof(IPin_vt));
|
||||
This->vt= malloc(sizeof(IPin_vt));
|
||||
|
||||
if (!This->vt)
|
||||
{
|
||||
@ -879,7 +879,7 @@ IMPLEMENT_IUNKNOWN(CBaseFilter)
|
||||
*/
|
||||
CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent)
|
||||
{
|
||||
CBaseFilter* This = (CBaseFilter*) malloc(sizeof(CBaseFilter));
|
||||
CBaseFilter* This = malloc(sizeof(CBaseFilter));
|
||||
if (!This)
|
||||
return NULL;
|
||||
|
||||
@ -888,7 +888,7 @@ CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent)
|
||||
This->pin = (IPin*) CInputPinCreate(This, type);
|
||||
This->unused_pin = (IPin*) CRemotePinCreate(This, parent->GetPin(parent));
|
||||
|
||||
This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
|
||||
This->vt = malloc(sizeof(IBaseFilter_vt));
|
||||
if (!This->vt || !This->pin || !This->unused_pin)
|
||||
{
|
||||
CBaseFilter_Destroy(This);
|
||||
@ -1214,7 +1214,7 @@ static GUID CBaseFilter2_interf3 =
|
||||
*/
|
||||
CBaseFilter2* CBaseFilter2Create()
|
||||
{
|
||||
CBaseFilter2* This = (CBaseFilter2*) malloc(sizeof(CBaseFilter2));
|
||||
CBaseFilter2* This = malloc(sizeof(CBaseFilter2));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -1222,7 +1222,7 @@ CBaseFilter2* CBaseFilter2Create()
|
||||
This->refcount = 1;
|
||||
This->pin = (IPin*) CRemotePin2Create(This);
|
||||
|
||||
This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
|
||||
This->vt = malloc(sizeof(IBaseFilter_vt));
|
||||
|
||||
if (!This->pin || !This->vt)
|
||||
{
|
||||
@ -1374,7 +1374,7 @@ IMPLEMENT_IUNKNOWN(CRemotePin)
|
||||
*/
|
||||
CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin)
|
||||
{
|
||||
CRemotePin* This = (CRemotePin*) malloc(sizeof(CRemotePin));
|
||||
CRemotePin* This = malloc(sizeof(CRemotePin));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -1385,7 +1385,7 @@ CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin)
|
||||
This->remote_pin = rpin;
|
||||
This->refcount = 1;
|
||||
|
||||
This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
|
||||
This->vt = malloc(sizeof(IPin_vt));
|
||||
|
||||
if (!This->vt)
|
||||
{
|
||||
@ -1464,7 +1464,7 @@ IMPLEMENT_IUNKNOWN(CRemotePin2)
|
||||
*/
|
||||
CRemotePin2* CRemotePin2Create(CBaseFilter2* p)
|
||||
{
|
||||
CRemotePin2* This = (CRemotePin2*) malloc(sizeof(CRemotePin2));
|
||||
CRemotePin2* This = malloc(sizeof(CRemotePin2));
|
||||
|
||||
if (!This)
|
||||
return NULL;
|
||||
@ -1474,7 +1474,7 @@ CRemotePin2* CRemotePin2Create(CBaseFilter2* p)
|
||||
This->parent = p;
|
||||
This->refcount = 1;
|
||||
|
||||
This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
|
||||
This->vt = malloc(sizeof(IPin_vt));
|
||||
|
||||
if (!This->vt)
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ static WINE_MODREF *ELFDLL_CreateModref(HMODULE hModule, LPCSTR path)
|
||||
// wm->binfmt.pe.pe_resource = (PIMAGE_RESOURCE_DIRECTORY)RVA(hModule, dir->VirtualAddress);
|
||||
|
||||
|
||||
wm->filename = (char*) malloc(strlen(path)+1);
|
||||
wm->filename = malloc(strlen(path)+1);
|
||||
strcpy(wm->filename, path);
|
||||
wm->modname = strrchr( wm->filename, '\\' );
|
||||
if (!wm->modname) wm->modname = wm->filename;
|
||||
@ -216,7 +216,7 @@ static WINE_MODREF *ELFDLL_CreateModref(HMODULE hModule, LPCSTR path)
|
||||
|
||||
if(local_wm)
|
||||
{
|
||||
local_wm->next = (modref_list*) malloc(sizeof(modref_list));
|
||||
local_wm->next = malloc(sizeof(modref_list));
|
||||
local_wm->next->prev=local_wm;
|
||||
local_wm->next->next=NULL;
|
||||
local_wm->next->wm=wm;
|
||||
@ -224,7 +224,7 @@ static WINE_MODREF *ELFDLL_CreateModref(HMODULE hModule, LPCSTR path)
|
||||
}
|
||||
else
|
||||
{
|
||||
local_wm = (modref_list*) malloc(sizeof(modref_list));
|
||||
local_wm = malloc(sizeof(modref_list));
|
||||
local_wm->next=local_wm->prev=NULL;
|
||||
local_wm->wm=wm;
|
||||
}
|
||||
|
14
loader/ext.c
14
loader/ext.c
@ -197,7 +197,7 @@ WIN_BOOL WINAPI IsBadReadPtr(LPCVOID data, UINT size)
|
||||
LPSTR HEAP_strdupA(HANDLE heap, DWORD flags, LPCSTR string)
|
||||
{
|
||||
// return strdup(string);
|
||||
char* answ = (char*) malloc(strlen(string) + 1);
|
||||
char* answ = malloc(strlen(string) + 1);
|
||||
strcpy(answ, string);
|
||||
return answ;
|
||||
}
|
||||
@ -208,7 +208,7 @@ LPWSTR HEAP_strdupAtoW(HANDLE heap, DWORD flags, LPCSTR string)
|
||||
if(string==0)
|
||||
return 0;
|
||||
size=strlen(string);
|
||||
answer = (WCHAR*) malloc(sizeof(WCHAR) * (size + 1));
|
||||
answer = malloc(sizeof(WCHAR) * (size + 1));
|
||||
for(i=0; i<=size; i++)
|
||||
answer[i]=(short)string[i];
|
||||
return answer;
|
||||
@ -222,7 +222,7 @@ LPSTR HEAP_strdupWtoA(HANDLE heap, DWORD flags, LPCWSTR string)
|
||||
size=0;
|
||||
while(string[size])
|
||||
size++;
|
||||
answer = (char*) malloc(size + 2);
|
||||
answer = malloc(size + 2);
|
||||
for(i=0; i<=size; i++)
|
||||
answer[i]=(char)string[i];
|
||||
return answer;
|
||||
@ -372,12 +372,12 @@ HANDLE WINAPI CreateFileMappingA(HANDLE handle, LPSECURITY_ATTRIBUTES lpAttr,
|
||||
{
|
||||
if(fm==0)
|
||||
{
|
||||
fm = (file_mapping*) malloc(sizeof(file_mapping));
|
||||
fm = malloc(sizeof(file_mapping));
|
||||
fm->prev=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fm->next = (file_mapping*) malloc(sizeof(file_mapping));
|
||||
fm->next = malloc(sizeof(file_mapping));
|
||||
fm->next->prev=fm;
|
||||
fm=fm->next;
|
||||
}
|
||||
@ -385,7 +385,7 @@ HANDLE WINAPI CreateFileMappingA(HANDLE handle, LPSECURITY_ATTRIBUTES lpAttr,
|
||||
fm->handle=answer;
|
||||
if(name)
|
||||
{
|
||||
fm->name = (char*) malloc(strlen(name)+1);
|
||||
fm->name = malloc(strlen(name)+1);
|
||||
strcpy(fm->name, name);
|
||||
}
|
||||
else
|
||||
@ -510,7 +510,7 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protec
|
||||
}
|
||||
else
|
||||
{
|
||||
virt_alloc *new_vm = (virt_alloc*) malloc(sizeof(virt_alloc));
|
||||
virt_alloc *new_vm = malloc(sizeof(virt_alloc));
|
||||
new_vm->mapping_size=size;
|
||||
new_vm->address=(char*)answer;
|
||||
new_vm->prev=vm;
|
||||
|
@ -182,7 +182,7 @@ ldt_fs_t* Setup_LDT_Keeper(void)
|
||||
{
|
||||
struct modify_ldt_ldt_s array;
|
||||
int ret;
|
||||
ldt_fs_t* ldt_fs = (ldt_fs_t*) malloc(sizeof(ldt_fs_t));
|
||||
ldt_fs_t* ldt_fs = malloc(sizeof(ldt_fs_t));
|
||||
|
||||
if (!ldt_fs)
|
||||
return NULL;
|
||||
|
@ -241,7 +241,7 @@ static WIN_BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
|
||||
//local_wm=wm;
|
||||
if(local_wm)
|
||||
{
|
||||
local_wm->next = (modref_list*) malloc(sizeof(modref_list));
|
||||
local_wm->next = malloc(sizeof(modref_list));
|
||||
local_wm->next->prev=local_wm;
|
||||
local_wm->next->next=NULL;
|
||||
local_wm->next->wm=wm;
|
||||
@ -854,7 +854,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
|
||||
// memory management:
|
||||
case 0x150011: //NewPtrClear
|
||||
case 0x150012: //NewPtrSysClear
|
||||
reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
|
||||
reg->eax = malloc(((uint32_t *)stack_base)[1]);
|
||||
memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
|
||||
#ifdef DEBUG_QTX_API
|
||||
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
|
||||
@ -862,7 +862,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
|
||||
return 1;
|
||||
case 0x15000F: //NewPtr
|
||||
case 0x150010: //NewPtrSys
|
||||
reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
|
||||
reg->eax = malloc(((uint32_t *)stack_base)[1]);
|
||||
#ifdef DEBUG_QTX_API
|
||||
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
|
||||
#endif
|
||||
|
@ -277,7 +277,7 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type
|
||||
{
|
||||
if(regs==0)
|
||||
create_registry();
|
||||
regs=(struct reg_value*)realloc(regs, sizeof(struct reg_value)*(reg_size+1));
|
||||
regs = realloc(regs, sizeof(struct reg_value) * (reg_size +1 ));
|
||||
//regs=(struct reg_value*)my_realloc(regs, sizeof(struct reg_value)*(reg_size+1));
|
||||
v=regs+reg_size;
|
||||
reg_size++;
|
||||
|
@ -358,7 +358,7 @@ void* mreq_private(int size, int to_zero, int type);
|
||||
void* mreq_private(int size, int to_zero, int type)
|
||||
{
|
||||
int nsize = size + sizeof(alloc_header);
|
||||
alloc_header* header = (alloc_header* ) malloc(nsize);
|
||||
alloc_header* header = malloc(nsize);
|
||||
if (!header)
|
||||
return 0;
|
||||
if (to_zero)
|
||||
@ -4716,7 +4716,7 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
|
||||
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
|
||||
|
||||
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
|
||||
test = (HPALETTE)malloc(i);
|
||||
test = malloc(i);
|
||||
memcpy((void *)test, lpgpl, i);
|
||||
|
||||
return test;
|
||||
|
12
m_config.c
12
m_config.c
@ -38,10 +38,10 @@
|
||||
#define MAX_PROFILE_DEPTH 20
|
||||
|
||||
static int
|
||||
parse_profile(const m_option_t *opt, const char *name, char *param, void *dst, int src);
|
||||
parse_profile(const m_option_t *opt, const char *name, const char *param, void *dst, int src);
|
||||
|
||||
static void
|
||||
set_profile(const m_option_t *opt, void* dst, void* src);
|
||||
set_profile(const m_option_t *opt, void* dst, const void* src);
|
||||
|
||||
static int
|
||||
show_profile(m_option_t *opt, char* name, char *param);
|
||||
@ -56,13 +56,13 @@ static void m_option_save(const m_config_t *config, const m_option_t *opt,
|
||||
void *dst)
|
||||
{
|
||||
if (opt->type->save) {
|
||||
void *src = opt->new ? (char*)config->optstruct + opt->offset : opt->p;
|
||||
const void *src = opt->new ? (char*)config->optstruct + opt->offset : opt->p;
|
||||
opt->type->save(opt, dst, src);
|
||||
}
|
||||
}
|
||||
|
||||
static void m_option_set(const m_config_t *config, const m_option_t *opt,
|
||||
void *src)
|
||||
const void *src)
|
||||
{
|
||||
if (opt->type->set) {
|
||||
void *dst = opt->new ? (char*)config->optstruct + opt->offset : opt->p;
|
||||
@ -505,7 +505,7 @@ m_config_set_profile(m_config_t* config, m_profile_t* p) {
|
||||
}
|
||||
|
||||
static int
|
||||
parse_profile(const m_option_t *opt, const char *name, char *param, void *dst, int src)
|
||||
parse_profile(const m_option_t *opt, const char *name, const char *param, void *dst, int src)
|
||||
{
|
||||
m_config_t* config = opt->priv;
|
||||
char** list = NULL;
|
||||
@ -541,7 +541,7 @@ parse_profile(const m_option_t *opt, const char *name, char *param, void *dst, i
|
||||
}
|
||||
|
||||
static void
|
||||
set_profile(const m_option_t *opt, void *dst, void *src) {
|
||||
set_profile(const m_option_t *opt, void *dst, const void *src) {
|
||||
m_config_t* config = opt->priv;
|
||||
m_profile_t* p;
|
||||
char** list = NULL;
|
||||
|
60
m_option.c
60
m_option.c
@ -57,7 +57,7 @@ const m_option_t* m_option_list_find(const m_option_t* list,const char* name) {
|
||||
|
||||
// Default function that just does a memcpy
|
||||
|
||||
static void copy_opt(const m_option_t* opt,void* dst,void* src) {
|
||||
static void copy_opt(const m_option_t* opt,void* dst,const void* src) {
|
||||
if(dst && src)
|
||||
memcpy(dst,src,opt->type->size);
|
||||
}
|
||||
@ -93,7 +93,7 @@ static char* dup_printf(const char *fmt, ...) {
|
||||
|
||||
#define VAL(x) (*(int*)(x))
|
||||
|
||||
static int parse_flag(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_flag(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
if (src == M_CONFIG_FILE) {
|
||||
if(!param) return M_OPT_MISSING_PARAM;
|
||||
if (!strcasecmp(param, "yes") || /* any other language? */
|
||||
@ -153,7 +153,7 @@ const m_option_type_t m_option_type_flag = {
|
||||
|
||||
// Integer
|
||||
|
||||
static int parse_int(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_int(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
long long tmp_int;
|
||||
char *endptr;
|
||||
src = 0;
|
||||
@ -226,7 +226,7 @@ const m_option_type_t m_option_type_int64 = {
|
||||
#undef VAL
|
||||
#define VAL(x) (*(double*)(x))
|
||||
|
||||
static int parse_double(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_double(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
double tmp_float;
|
||||
char* endptr;
|
||||
src = 0;
|
||||
@ -296,7 +296,7 @@ const m_option_type_t m_option_type_double = {
|
||||
#undef VAL
|
||||
#define VAL(x) (*(float*)(x))
|
||||
|
||||
static int parse_float(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_float(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
double tmp;
|
||||
int r= parse_double(opt, name, param, &tmp, src);
|
||||
if(r==1 && dst) VAL(dst) = tmp;
|
||||
@ -325,7 +325,7 @@ const m_option_type_t m_option_type_float = {
|
||||
#undef VAL
|
||||
#define VAL(x) (*(off_t*)(x))
|
||||
|
||||
static int parse_position(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_position(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
off_t tmp_off;
|
||||
char dummy;
|
||||
|
||||
@ -381,7 +381,7 @@ const m_option_type_t m_option_type_position = {
|
||||
#undef VAL
|
||||
#define VAL(x) (*(char**)(x))
|
||||
|
||||
static int parse_str(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_str(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
|
||||
|
||||
if (param == NULL)
|
||||
@ -413,7 +413,7 @@ static char* print_str(const m_option_t* opt, const void* val) {
|
||||
return (val && VAL(val) && strlen(VAL(val)) > 0) ? strdup(VAL(val)) : NULL;
|
||||
}
|
||||
|
||||
static void copy_str(const m_option_t* opt,void* dst, void* src) {
|
||||
static void copy_str(const m_option_t* opt,void* dst, const void* src) {
|
||||
if(dst && src) {
|
||||
#ifndef NO_FREE
|
||||
if(VAL(dst)) free(VAL(dst)); //FIXME!!!
|
||||
@ -561,10 +561,10 @@ static char *get_nextsep(char *ptr, char sep, int modify) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static int parse_str_list(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_str_list(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
int n = 0,len = strlen(opt->name);
|
||||
char *str;
|
||||
char *ptr = param, *last_ptr, **res;
|
||||
char *ptr = (char *)param, *last_ptr, **res;
|
||||
int op = OP_NONE;
|
||||
|
||||
if(opt->name[len-1] == '*' && ((int)strlen(name) > len - 1)) {
|
||||
@ -648,7 +648,7 @@ static int parse_str_list(const m_option_t* opt,const char *name, char *param, v
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void copy_str_list(const m_option_t* opt,void* dst, void* src) {
|
||||
static void copy_str_list(const m_option_t* opt,void* dst, const void* src) {
|
||||
int n;
|
||||
char **d,**s;
|
||||
|
||||
@ -743,7 +743,7 @@ static void free_func_pf(void* src) {
|
||||
}
|
||||
|
||||
// Parser for func_param and func_full
|
||||
static int parse_func_pf(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_func_pf(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
m_func_save_t *s,*p;
|
||||
|
||||
if(!dst)
|
||||
@ -764,7 +764,7 @@ static int parse_func_pf(const m_option_t* opt,const char *name, char *param, vo
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void copy_func_pf(const m_option_t* opt,void* dst, void* src) {
|
||||
static void copy_func_pf(const m_option_t* opt,void* dst, const void* src) {
|
||||
m_func_save_t *d = NULL, *s,* last = NULL;
|
||||
|
||||
if(!(dst && src)) return;
|
||||
@ -790,7 +790,7 @@ static void copy_func_pf(const m_option_t* opt,void* dst, void* src) {
|
||||
|
||||
/////////////////// Func_param
|
||||
|
||||
static void set_func_param(const m_option_t* opt, void* dst, void* src) {
|
||||
static void set_func_param(const m_option_t* opt, void* dst, const void* src) {
|
||||
m_func_save_t* s;
|
||||
|
||||
if(!src) return;
|
||||
@ -817,7 +817,7 @@ const m_option_type_t m_option_type_func_param = {
|
||||
|
||||
/////////////////// Func_full
|
||||
|
||||
static void set_func_full(const m_option_t* opt, void* dst, void* src) {
|
||||
static void set_func_full(const m_option_t* opt, void* dst, const void* src) {
|
||||
m_func_save_t* s;
|
||||
|
||||
if(!src) return;
|
||||
@ -846,11 +846,11 @@ const m_option_type_t m_option_type_func_full = {
|
||||
|
||||
#undef VAL
|
||||
|
||||
static int parse_func(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_func(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void set_func(const m_option_t* opt,void* dst, void* src) {
|
||||
static void set_func(const m_option_t* opt,void* dst, const void* src) {
|
||||
((m_opt_func_t) opt->p)(opt);
|
||||
}
|
||||
|
||||
@ -869,7 +869,7 @@ const m_option_type_t m_option_type_func = {
|
||||
|
||||
/////////////////// Print
|
||||
|
||||
static int parse_print(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_print(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
if(opt->type == CONF_TYPE_PRINT_INDIRECT)
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", *(char **) opt->p);
|
||||
else if(opt->type == CONF_TYPE_PRINT_FUNC)
|
||||
@ -926,7 +926,7 @@ const m_option_type_t m_option_type_print_func = {
|
||||
#undef VAL
|
||||
#define VAL(x) (*(char***)(x))
|
||||
|
||||
static int parse_subconf(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_subconf(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
char *subparam;
|
||||
char *subopt;
|
||||
int nr = 0,i,r;
|
||||
@ -1003,7 +1003,7 @@ static int parse_subconf(const m_option_t* opt,const char *name, char *param, vo
|
||||
subparam[0] == 0 ? NULL : subparam,NULL,src);
|
||||
if(r < 0) return r;
|
||||
if(dst) {
|
||||
lst = (char**)realloc(lst,2 * (nr+2) * sizeof(char*));
|
||||
lst = realloc(lst,2 * (nr+2) * sizeof(char*));
|
||||
lst[2*nr] = strdup(subopt);
|
||||
lst[2*nr+1] = subparam[0] == 0 ? NULL : strdup(subparam);
|
||||
memset(&lst[2*(nr+1)],0,2*sizeof(char*));
|
||||
@ -1096,7 +1096,7 @@ static struct {
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static int parse_imgfmt(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_imgfmt(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
uint32_t fmt = 0;
|
||||
int i;
|
||||
|
||||
@ -1186,7 +1186,7 @@ static struct {
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static int parse_afmt(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_afmt(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
uint32_t fmt = 0;
|
||||
int i;
|
||||
|
||||
@ -1249,7 +1249,7 @@ static double parse_timestring(const char *str)
|
||||
}
|
||||
|
||||
|
||||
static int parse_time(const m_option_t* opt,const char *name, char *param, void* dst, int src)
|
||||
static int parse_time(const m_option_t* opt,const char *name, const char *param, void* dst, int src)
|
||||
{
|
||||
double time;
|
||||
|
||||
@ -1284,7 +1284,7 @@ const m_option_type_t m_option_type_time = {
|
||||
|
||||
// Time or size (-endpos)
|
||||
|
||||
static int parse_time_size(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
static int parse_time_size(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
m_time_size_t ts;
|
||||
char unit[4];
|
||||
double end_at;
|
||||
@ -1515,7 +1515,7 @@ static int get_obj_params(const char* opt_name, const char* name,char* params,
|
||||
}
|
||||
|
||||
static int parse_obj_params(const m_option_t* opt,const char *name,
|
||||
char *param, void* dst, int src) {
|
||||
const char *param, void* dst, int src) {
|
||||
char** opts;
|
||||
int r;
|
||||
m_obj_params_t* p = opt->priv;
|
||||
@ -1629,7 +1629,7 @@ static int parse_obj_settings(const char* opt,char* str,const m_obj_list_t* list
|
||||
|
||||
static void free_obj_settings_list(void* dst);
|
||||
|
||||
static int obj_settings_list_del(const char *opt_name,char *param,void* dst, int src) {
|
||||
static int obj_settings_list_del(const char *opt_name,const char *param,void* dst, int src) {
|
||||
char** str_list = NULL;
|
||||
int r,i,idx_max = 0;
|
||||
char* rem_id = "_removed_marker_";
|
||||
@ -1688,7 +1688,7 @@ static int obj_settings_list_del(const char *opt_name,char *param,void* dst, int
|
||||
}
|
||||
|
||||
static int parse_obj_settings_list(const m_option_t* opt,const char *name,
|
||||
char *param, void* dst, int src) {
|
||||
const char *param, void* dst, int src) {
|
||||
int n = 0,r,len = strlen(opt->name);
|
||||
char *str;
|
||||
char *ptr, *last_ptr;
|
||||
@ -1841,7 +1841,7 @@ static void free_obj_settings_list(void* dst) {
|
||||
VAL(dst) = NULL;
|
||||
}
|
||||
|
||||
static void copy_obj_settings_list(const m_option_t* opt,void* dst, void* src) {
|
||||
static void copy_obj_settings_list(const m_option_t* opt,void* dst, const void* src) {
|
||||
m_obj_settings_t *d,*s;
|
||||
int n;
|
||||
|
||||
@ -1885,7 +1885,7 @@ const m_option_type_t m_option_type_obj_settings_list = {
|
||||
|
||||
|
||||
static int parse_obj_presets(const m_option_t* opt,const char *name,
|
||||
char *param, void* dst, int src) {
|
||||
const char *param, void* dst, int src) {
|
||||
m_obj_presets_t* obj_p = (m_obj_presets_t*)opt->priv;
|
||||
m_struct_t *in_desc,*out_desc;
|
||||
int s,i;
|
||||
@ -1957,7 +1957,7 @@ const m_option_type_t m_option_type_obj_presets = {
|
||||
};
|
||||
|
||||
static int parse_custom_url(const m_option_t* opt,const char *name,
|
||||
char *url, void* dst, int src) {
|
||||
const char *url, void* dst, int src) {
|
||||
int pos1, pos2, r, v6addr = 0;
|
||||
char *ptr1=NULL, *ptr2=NULL, *ptr3=NULL, *ptr4=NULL;
|
||||
m_struct_t* desc = opt->priv;
|
||||
|
18
m_option.h
18
m_option.h
@ -69,7 +69,7 @@ extern const m_option_type_t m_option_type_func;
|
||||
typedef void (*m_opt_default_func_t)(const m_option_t *, const char*);
|
||||
|
||||
/// Callback used by m_option_type_func_full options.
|
||||
typedef int (*m_opt_func_full_t)(const m_option_t *, const char *, char *);
|
||||
typedef int (*m_opt_func_full_t)(const m_option_t *, const char *, const char *);
|
||||
|
||||
/// Callback used by m_option_type_func_param options.
|
||||
typedef int (*m_opt_func_param_t)(const m_option_t *, const char *);
|
||||
@ -199,9 +199,9 @@ extern const m_obj_params_t m_span_params_def;
|
||||
|
||||
/// Option type description
|
||||
struct m_option_type {
|
||||
char* name;
|
||||
const char* name;
|
||||
/// Syntax description, etc
|
||||
char* comments;
|
||||
const char* comments;
|
||||
/// Size needed for the data.
|
||||
unsigned int size;
|
||||
/// See \ref OptionTypeFlags.
|
||||
@ -219,7 +219,7 @@ struct m_option_type {
|
||||
* \return On error a negative value is returned, on success the number of arguments
|
||||
* consumed. For details see \ref OptionParserReturn.
|
||||
*/
|
||||
int (*parse)(const m_option_t* opt,const char *name, char *param, void* dst, int src);
|
||||
int (*parse)(const m_option_t* opt,const char *name, const char *param, void* dst, int src);
|
||||
|
||||
/// Print back a value in string form.
|
||||
/** \param opt The option to print.
|
||||
@ -242,21 +242,21 @@ struct m_option_type {
|
||||
* \param dst Pointer to the destination memory.
|
||||
* \param src Pointer to the source memory.
|
||||
*/
|
||||
void (*save)(const m_option_t* opt,void* dst, void* src);
|
||||
void (*save)(const m_option_t* opt,void* dst, const void* src);
|
||||
|
||||
/// Set the value in the program (dst) from a save slot.
|
||||
/** \param opt The option to copy.
|
||||
* \param dst Pointer to the destination memory.
|
||||
* \param src Pointer to the source memory.
|
||||
*/
|
||||
void (*set)(const m_option_t* opt,void* dst, void* src);
|
||||
void (*set)(const m_option_t* opt,void* dst, const void* src);
|
||||
|
||||
/// Copy the data between two save slots. If NULL and size is > 0 a memcpy will be used.
|
||||
/** \param opt The option to copy.
|
||||
* \param dst Pointer to the destination memory.
|
||||
* \param src Pointer to the source memory.
|
||||
*/
|
||||
void (*copy)(const m_option_t* opt,void* dst, void* src);
|
||||
void (*copy)(const m_option_t* opt,void* dst, const void* src);
|
||||
//@}
|
||||
|
||||
/// Free the data allocated for a save slot.
|
||||
@ -488,7 +488,7 @@ const m_option_t* m_option_list_find(const m_option_t* list,const char* name);
|
||||
|
||||
/// Helper to parse options, see \ref m_option_type::parse.
|
||||
inline static int
|
||||
m_option_parse(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
|
||||
m_option_parse(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
|
||||
return opt->type->parse(opt,name,param,dst,src);
|
||||
}
|
||||
|
||||
@ -503,7 +503,7 @@ m_option_print(const m_option_t* opt, const void* val_ptr) {
|
||||
|
||||
/// Helper around \ref m_option_type::copy.
|
||||
inline static void
|
||||
m_option_copy(const m_option_t* opt,void* dst, void* src) {
|
||||
m_option_copy(const m_option_t* opt,void* dst, const void* src) {
|
||||
if(opt->type->copy)
|
||||
opt->type->copy(opt,dst,src);
|
||||
else if(opt->type->size > 0)
|
||||
|
@ -68,7 +68,7 @@ m_struct_alloc(const m_struct_t* st) {
|
||||
}
|
||||
|
||||
int
|
||||
m_struct_set(const m_struct_t* st, void* obj, char* field, char* param) {
|
||||
m_struct_set(const m_struct_t* st, void* obj, const char* field, const char* param) {
|
||||
const m_option_t* f = m_struct_get_field(st,field);
|
||||
|
||||
if(!f) {
|
||||
|
@ -88,7 +88,7 @@ m_struct_alloc(const m_struct_t* st);
|
||||
* \return 0 on error, 1 on success.
|
||||
*/
|
||||
int
|
||||
m_struct_set(const m_struct_t* st, void* obj, char* field, char* param);
|
||||
m_struct_set(const m_struct_t* st, void* obj, const char* field, const char* param);
|
||||
|
||||
/// Reset a field (or all if field == NULL) to defaults.
|
||||
/** \param st Struct definition.
|
||||
|
@ -5,7 +5,7 @@ void init_spline(float *x, float *y, int n, float *y2)
|
||||
|
||||
int i, k;
|
||||
float p, qn, sig, un, *u;
|
||||
u = (float *) malloc(n * sizeof (float));
|
||||
u = malloc(n * sizeof (float));
|
||||
|
||||
y2[0] = u[0] = 0.0;
|
||||
|
||||
|
@ -84,7 +84,7 @@ void *mmap( void *addr, size_t len, int prot, int flags, int fildes, off_t off )
|
||||
return MAP_FAILED;
|
||||
}
|
||||
|
||||
new_mmap = ( os2_mmap * )malloc( sizeof( os2_mmap ));
|
||||
new_mmap = malloc( sizeof( os2_mmap ));
|
||||
new_mmap->addr = ret;
|
||||
new_mmap->len = len;
|
||||
new_mmap->flags = flags;
|
||||
|
12
playtree.c
12
playtree.c
@ -283,7 +283,7 @@ play_tree_add_file(play_tree_t* pt,char* file) {
|
||||
for(n = 0 ; pt->files[n] != NULL ; n++)
|
||||
/* NOTHING */;
|
||||
}
|
||||
pt->files = (char**)realloc(pt->files,(n+2)*sizeof(char*));
|
||||
pt->files = realloc(pt->files, (n + 2) * sizeof(char*));
|
||||
if(pt->files ==NULL) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",(n+2)*(int)sizeof(char*));
|
||||
return;
|
||||
@ -322,7 +322,7 @@ play_tree_remove_file(play_tree_t* pt,char* file) {
|
||||
|
||||
if(n > 1) {
|
||||
memmove(&pt->files[f],&pt->files[f+1],(n-f)*sizeof(char*));
|
||||
pt->files = (char**)realloc(pt->files,n*sizeof(char*));
|
||||
pt->files = realloc(pt->files, n * sizeof(char*));
|
||||
if(pt->files == NULL) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",(n+2)*(int)sizeof(char*));
|
||||
return -1;
|
||||
@ -347,7 +347,7 @@ play_tree_set_param(play_tree_t* pt, char* name, char* val) {
|
||||
if(pt->params)
|
||||
for ( ; pt->params[n].name != NULL ; n++ ) { }
|
||||
|
||||
pt->params = (play_tree_param_t*)realloc(pt->params,(n+2)*sizeof(play_tree_param_t));
|
||||
pt->params = realloc(pt->params, (n + 2) * sizeof(play_tree_param_t));
|
||||
if(pt->params == NULL) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't realloc params (%d bytes of memory)\n",(n+2)*(int)sizeof(play_tree_param_t));
|
||||
return;
|
||||
@ -382,7 +382,7 @@ play_tree_unset_param(play_tree_t* pt, char* name) {
|
||||
|
||||
if(n > 1) {
|
||||
memmove(&pt->params[ni],&pt->params[ni+1],(n-ni)*sizeof(play_tree_param_t));
|
||||
pt->params = (play_tree_param_t*)realloc(pt->params,n*sizeof(play_tree_param_t));
|
||||
pt->params = realloc(pt->params, n * sizeof(play_tree_param_t));
|
||||
if(pt->params == NULL) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",n*(int)sizeof(play_tree_param_t));
|
||||
return -1;
|
||||
@ -707,7 +707,7 @@ play_tree_iter_up_step(play_tree_iter_t* iter, int d,int with_nodes) {
|
||||
iter->stack_size--;
|
||||
iter->loop = iter->status_stack[iter->stack_size];
|
||||
if(iter->stack_size > 0)
|
||||
iter->status_stack = (int*)realloc(iter->status_stack,iter->stack_size*sizeof(int));
|
||||
iter->status_stack = realloc(iter->status_stack, iter->stack_size * sizeof(int));
|
||||
else {
|
||||
free(iter->status_stack);
|
||||
iter->status_stack = NULL;
|
||||
@ -745,7 +745,7 @@ play_tree_iter_down_step(play_tree_iter_t* iter, int d,int with_nodes) {
|
||||
play_tree_iter_push_params(iter);
|
||||
|
||||
iter->stack_size++;
|
||||
iter->status_stack = (int*)realloc(iter->status_stack,iter->stack_size*sizeof(int));
|
||||
iter->status_stack = realloc(iter->status_stack, iter->stack_size * sizeof(int));
|
||||
if(iter->status_stack == NULL) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",iter->stack_size*(int)sizeof(int));
|
||||
return PLAY_TREE_ITER_ERROR;
|
||||
|
@ -81,7 +81,7 @@ play_tree_parser_get_line(play_tree_parser_t* p) {
|
||||
|
||||
if(resize) {
|
||||
r = p->iter - p->buffer;
|
||||
p->buffer = (char*)realloc(p->buffer,p->buffer_size+BUF_STEP);
|
||||
p->buffer = realloc(p->buffer, p->buffer_size + BUF_STEP);
|
||||
p->iter = p->buffer + r;
|
||||
p->buffer_size += BUF_STEP;
|
||||
resize = 0;
|
||||
@ -113,7 +113,7 @@ play_tree_parser_get_line(play_tree_parser_t* p) {
|
||||
|
||||
line_end = (end > p->iter && *(end-1) == '\r') ? end-1 : end;
|
||||
if(line_end - p->iter >= 0)
|
||||
p->line = (char*)realloc(p->line,line_end - p->iter+1);
|
||||
p->line = realloc(p->line, line_end - p->iter + 1);
|
||||
else
|
||||
return NULL;
|
||||
if(line_end - p->iter > 0)
|
||||
@ -252,7 +252,7 @@ pls_read_entry(char* line,pls_entry_t** _e,int* _max_entry,char** val) {
|
||||
mp_msg(MSGT_PLAYTREE,MSGL_WARN,"No entry index in entry %s\nAssuming %d\n",line,num);
|
||||
}
|
||||
if(num > max_entry) {
|
||||
e = (pls_entry_t*)realloc(e,num*sizeof(pls_entry_t));
|
||||
e = realloc(e, num * sizeof(pls_entry_t));
|
||||
memset(&e[max_entry],0,(num-max_entry)*sizeof(pls_entry_t));
|
||||
max_entry = num;
|
||||
}
|
||||
@ -713,12 +713,12 @@ play_tree_add_basepath(play_tree_t* pt, char* bp) {
|
||||
if (pt->files[i][0] == '\\') {
|
||||
if (pt->files[i][1] == '\\')
|
||||
continue;
|
||||
pt->files[i] = (char*)realloc(pt->files[i],2+fl+1);
|
||||
pt->files[i] = realloc(pt->files[i], 2 + fl + 1);
|
||||
memmove(pt->files[i] + 2,pt->files[i],fl+1);
|
||||
memcpy(pt->files[i],bp,2);
|
||||
continue;
|
||||
}
|
||||
pt->files[i] = (char*)realloc(pt->files[i],bl+fl+1);
|
||||
pt->files[i] = realloc(pt->files[i], bl + fl + 1);
|
||||
memmove(pt->files[i] + bl,pt->files[i],fl+1);
|
||||
memcpy(pt->files[i],bp,bl);
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ http_response_append( HTTP_header_t *http_hdr, char *response, int length ) {
|
||||
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Bad size in memory (re)allocation\n");
|
||||
return -1;
|
||||
}
|
||||
http_hdr->buffer = (char*)realloc( http_hdr->buffer, http_hdr->buffer_size+length+1 );
|
||||
http_hdr->buffer = realloc( http_hdr->buffer, http_hdr->buffer_size+length+1 );
|
||||
if( http_hdr->buffer==NULL ) {
|
||||
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory (re)allocation failed\n");
|
||||
return -1;
|
||||
@ -428,7 +428,7 @@ http_response_parse( HTTP_header_t *http_hdr ) {
|
||||
while( *ptr!='\r' && *ptr!='\n' ) ptr++;
|
||||
len = ptr-hdr_ptr;
|
||||
if( len==0 ) break;
|
||||
field = (char*)realloc(field, len+1);
|
||||
field = realloc(field, len+1);
|
||||
if( field==NULL ) {
|
||||
mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n");
|
||||
return -1;
|
||||
@ -520,7 +520,7 @@ char *
|
||||
http_get_field( HTTP_header_t *http_hdr, const char *field_name ) {
|
||||
if( http_hdr==NULL || field_name==NULL ) return NULL;
|
||||
http_hdr->field_search_pos = http_hdr->first_field;
|
||||
http_hdr->field_search = (char*)realloc( http_hdr->field_search, strlen(field_name)+1 );
|
||||
http_hdr->field_search = realloc( http_hdr->field_search, strlen(field_name)+1 );
|
||||
if( http_hdr->field_search==NULL ) {
|
||||
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
|
||||
return NULL;
|
||||
|
@ -47,7 +47,8 @@ int dvd_title=0;
|
||||
|
||||
// Open a new stream (stdin/file/vcd/url)
|
||||
|
||||
stream_t* open_stream(char* filename, struct MPOpts *options, int* file_format)
|
||||
stream_t* open_stream(const char *filename, struct MPOpts *options,
|
||||
int *file_format)
|
||||
{
|
||||
// Check if playlist or unknown
|
||||
if (*file_format != DEMUXER_TYPE_PLAYLIST){
|
||||
|
@ -142,7 +142,8 @@ static const stream_info_t* const auto_open_streams[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static stream_t *open_stream_plugin(const stream_info_t *sinfo, char *filename,
|
||||
static stream_t *open_stream_plugin(const stream_info_t *sinfo,
|
||||
const char *filename,
|
||||
int mode, struct MPOpts *options,
|
||||
int *file_format, int *ret,
|
||||
char **redirected_url)
|
||||
@ -202,8 +203,8 @@ static stream_t *open_stream_plugin(const stream_info_t *sinfo, char *filename,
|
||||
}
|
||||
|
||||
|
||||
stream_t *open_stream_full(char *filename,int mode, struct MPOpts *options,
|
||||
int* file_format)
|
||||
stream_t *open_stream_full(const char *filename, int mode,
|
||||
struct MPOpts *options, int *file_format)
|
||||
{
|
||||
int i,j,l,r;
|
||||
const stream_info_t* sinfo;
|
||||
@ -246,7 +247,7 @@ stream_t *open_stream_full(char *filename,int mode, struct MPOpts *options,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
stream_t *open_output_stream(char *filename, struct MPOpts *options)
|
||||
stream_t *open_output_stream(const char *filename, struct MPOpts *options)
|
||||
{
|
||||
int file_format; //unused
|
||||
if(!filename) {
|
||||
|
@ -345,9 +345,11 @@ int stream_control(stream_t *s, int cmd, void *arg);
|
||||
stream_t* new_stream(int fd,int type);
|
||||
void free_stream(stream_t *s);
|
||||
stream_t* new_memory_stream(unsigned char* data,int len);
|
||||
stream_t* open_stream(char* filename, struct MPOpts *options,int* file_format);
|
||||
stream_t* open_stream_full(char* filename,int mode, struct MPOpts *options, int* file_format);
|
||||
stream_t* open_output_stream(char* filename,struct MPOpts *options);
|
||||
stream_t *open_stream(const char *filename, struct MPOpts *options,
|
||||
int *file_format);
|
||||
stream_t *open_stream_full(const char *filename,int mode,
|
||||
struct MPOpts *options, int *file_format);
|
||||
stream_t *open_output_stream(const char *filename, struct MPOpts *options);
|
||||
/// Set the callback to be used by libstream to check for user
|
||||
/// interruption during long blocking operations (cache filling, etc).
|
||||
struct input_ctx;
|
||||
|
@ -81,12 +81,10 @@
|
||||
#define DEFAULT_FREEDB_SERVER "freedb.freedb.org"
|
||||
#define DEFAULT_CACHE_DIR "/.cddb/"
|
||||
|
||||
stream_t* open_cdda(char *dev, char *track);
|
||||
|
||||
static cd_toc_t cdtoc[100];
|
||||
static int cdtoc_last_track;
|
||||
|
||||
int read_toc(const char *dev)
|
||||
static int read_toc(const char *dev)
|
||||
{
|
||||
int first = 0, last = -1;
|
||||
int i;
|
||||
@ -255,7 +253,7 @@ int cdd_identify(const char *dev)
|
||||
return cdtoc_last_track;
|
||||
}
|
||||
|
||||
unsigned int cddb_sum(int n)
|
||||
static unsigned int cddb_sum(int n)
|
||||
{
|
||||
unsigned int ret;
|
||||
|
||||
@ -267,7 +265,7 @@ unsigned int cddb_sum(int n)
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long cddb_discid(int tot_trks)
|
||||
static unsigned long cddb_discid(int tot_trks)
|
||||
{
|
||||
unsigned int i, t = 0, n = 0;
|
||||
|
||||
@ -283,7 +281,7 @@ unsigned long cddb_discid(int tot_trks)
|
||||
|
||||
|
||||
|
||||
int cddb_http_request(char *command,
|
||||
static int cddb_http_request(char *command,
|
||||
int (*reply_parser)(HTTP_header_t*, cddb_data_t*),
|
||||
cddb_data_t *cddb_data)
|
||||
{
|
||||
@ -338,7 +336,7 @@ int cddb_http_request(char *command,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cddb_read_cache(cddb_data_t *cddb_data)
|
||||
static int cddb_read_cache(cddb_data_t *cddb_data)
|
||||
{
|
||||
char file_name[100];
|
||||
struct stat stats;
|
||||
@ -383,7 +381,7 @@ int cddb_read_cache(cddb_data_t *cddb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cddb_write_cache(cddb_data_t *cddb_data)
|
||||
static int cddb_write_cache(cddb_data_t *cddb_data)
|
||||
{
|
||||
// We have the file, save it for cache.
|
||||
struct stat file_stat;
|
||||
@ -436,7 +434,7 @@ int cddb_write_cache(cddb_data_t *cddb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
static int cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
{
|
||||
unsigned long disc_id;
|
||||
char category[100];
|
||||
@ -495,7 +493,7 @@ int cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cddb_request_titles(cddb_data_t *cddb_data)
|
||||
static int cddb_request_titles(cddb_data_t *cddb_data)
|
||||
{
|
||||
char command[1024];
|
||||
sprintf(command, "cddb+read+%s+%08lx",
|
||||
@ -503,7 +501,7 @@ int cddb_request_titles(cddb_data_t *cddb_data)
|
||||
return cddb_http_request(command, cddb_read_parse, cddb_data);
|
||||
}
|
||||
|
||||
int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
static int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
{
|
||||
char album_title[100];
|
||||
char *ptr = NULL;
|
||||
@ -541,7 +539,7 @@ int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
static int cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
{
|
||||
char album_title[100];
|
||||
char *ptr = NULL;
|
||||
@ -607,7 +605,7 @@ blues c711930d Santana / Supernatural
|
||||
return -1;
|
||||
}
|
||||
|
||||
int cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
static int cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
{
|
||||
int max;
|
||||
int ret, status;
|
||||
@ -639,12 +637,12 @@ int cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int cddb_get_proto_level(cddb_data_t *cddb_data)
|
||||
static int cddb_get_proto_level(cddb_data_t *cddb_data)
|
||||
{
|
||||
return cddb_http_request("stat", cddb_proto_level_parse, cddb_data);
|
||||
}
|
||||
|
||||
int cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
static int cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
{
|
||||
int ret, status;
|
||||
|
||||
@ -668,12 +666,12 @@ int cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int cddb_get_freedb_sites(cddb_data_t *cddb_data)
|
||||
static int cddb_get_freedb_sites(cddb_data_t *cddb_data)
|
||||
{
|
||||
return cddb_http_request("sites", cddb_freedb_sites_parse, cddb_data);
|
||||
}
|
||||
|
||||
void cddb_create_hello(cddb_data_t *cddb_data)
|
||||
static void cddb_create_hello(cddb_data_t *cddb_data)
|
||||
{
|
||||
char host_name[51];
|
||||
char *user_name;
|
||||
@ -696,7 +694,7 @@ void cddb_create_hello(cddb_data_t *cddb_data)
|
||||
user_name, host_name, "MPlayer", VERSION);
|
||||
}
|
||||
|
||||
int cddb_retrieve(cddb_data_t *cddb_data)
|
||||
static int cddb_retrieve(cddb_data_t *cddb_data)
|
||||
{
|
||||
char offsets[1024], command[1024];
|
||||
char *ptr;
|
||||
@ -804,7 +802,7 @@ int cddb_resolve(const char *dev, char **xmcd_file)
|
||||
/***************
|
||||
* xmcd parser *
|
||||
***************/
|
||||
char *xmcd_parse_dtitle(cd_info_t *cd_info, char *line)
|
||||
static char *xmcd_parse_dtitle(cd_info_t *cd_info, char *line)
|
||||
{
|
||||
char *ptr, *album;
|
||||
ptr = strstr(line, "DTITLE=");
|
||||
@ -829,7 +827,7 @@ char *xmcd_parse_dtitle(cd_info_t *cd_info, char *line)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char *xmcd_parse_dgenre(cd_info_t *cd_info, char *line)
|
||||
static char *xmcd_parse_dgenre(cd_info_t *cd_info, char *line)
|
||||
{
|
||||
char *ptr;
|
||||
ptr = strstr(line, "DGENRE=");
|
||||
@ -844,7 +842,7 @@ char *xmcd_parse_dgenre(cd_info_t *cd_info, char *line)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char *xmcd_parse_ttitle(cd_info_t *cd_info, char *line)
|
||||
static char *xmcd_parse_ttitle(cd_info_t *cd_info, char *line)
|
||||
{
|
||||
unsigned int track_nb;
|
||||
unsigned long sec, off;
|
||||
|
@ -89,8 +89,7 @@ static int net_read(int fd, char* buf, int len) {
|
||||
|
||||
static mp_net_stream_packet_t* read_packet(int fd) {
|
||||
uint16_t len;
|
||||
mp_net_stream_packet_t* pack =
|
||||
(mp_net_stream_packet_t*)malloc(sizeof(mp_net_stream_packet_t));
|
||||
mp_net_stream_packet_t* pack = malloc(sizeof(mp_net_stream_packet_t));
|
||||
|
||||
if(!net_read(fd,(char*)pack,sizeof(mp_net_stream_packet_t))) {
|
||||
free(pack);
|
||||
|
@ -47,11 +47,11 @@ static const tvi_functions_t functions =
|
||||
|
||||
static tvi_handle_t *new_handle(void)
|
||||
{
|
||||
tvi_handle_t *h = (tvi_handle_t *)malloc(sizeof(tvi_handle_t));
|
||||
tvi_handle_t *h = malloc(sizeof(tvi_handle_t));
|
||||
|
||||
if (!h)
|
||||
return NULL;
|
||||
h->priv = (priv_t *)malloc(sizeof(priv_t));
|
||||
h->priv = malloc(sizeof(priv_t));
|
||||
if (!h->priv)
|
||||
{
|
||||
free(h);
|
||||
|
@ -796,19 +796,19 @@ static HRESULT init_ringbuffer(grabber_ringbuffer_t * rb, int buffersize,
|
||||
mp_msg(MSGT_TV, MSGL_DBG2, "tvi_dshow: Capture buffer: %d blocks of %d bytes.\n",
|
||||
rb->buffersize, rb->blocksize);
|
||||
|
||||
rb->ringbuffer = (char **) malloc(rb->buffersize * sizeof(char *));
|
||||
rb->ringbuffer = malloc(rb->buffersize * sizeof(char *));
|
||||
if (!rb)
|
||||
return E_POINTER;
|
||||
memset(rb->ringbuffer, 0, rb->buffersize * sizeof(char *));
|
||||
|
||||
for (i = 0; i < rb->buffersize; i++) {
|
||||
rb->ringbuffer[i] = (char *) malloc(rb->blocksize * sizeof(char));
|
||||
rb->ringbuffer[i] = malloc(rb->blocksize * sizeof(char));
|
||||
if (!rb->ringbuffer[i]) {
|
||||
destroy_ringbuffer(rb);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
}
|
||||
rb->dpts = (double*) malloc(rb->buffersize * sizeof(double));
|
||||
rb->dpts = malloc(rb->buffersize * sizeof(double));
|
||||
if (!rb->dpts) {
|
||||
destroy_ringbuffer(rb);
|
||||
return E_OUTOFMEMORY;
|
||||
@ -817,7 +817,7 @@ static HRESULT init_ringbuffer(grabber_ringbuffer_t * rb, int buffersize,
|
||||
rb->tail = 0;
|
||||
rb->count = 0;
|
||||
rb->tStart = -1;
|
||||
rb->pMutex = (CRITICAL_SECTION *) malloc(sizeof(CRITICAL_SECTION));
|
||||
rb->pMutex = malloc(sizeof(CRITICAL_SECTION));
|
||||
if (!rb->pMutex) {
|
||||
destroy_ringbuffer(rb);
|
||||
return E_OUTOFMEMORY;
|
||||
@ -966,7 +966,7 @@ static HRESULT load_freq_table(int nCountry, int nInputType,
|
||||
}
|
||||
*pnFirst = plFreqTable[0];
|
||||
*pnLen = (int) (plFreqTable[1] - plFreqTable[0] + 1);
|
||||
*pplFreqTable = (long *) malloc((*pnLen) * sizeof(long));
|
||||
*pplFreqTable = malloc((*pnLen) * sizeof(long));
|
||||
if (!*pplFreqTable) {
|
||||
FreeLibrary(hDLL);
|
||||
return E_FAIL;
|
||||
@ -1273,7 +1273,7 @@ static void get_capabilities(priv_t * priv)
|
||||
OLE_CALL_ARGS(priv->pCrossbar, get_PinCounts, &lOutputPins,
|
||||
&lInputPins);
|
||||
|
||||
tv_available_inputs = (long *) malloc(sizeof(long) * lInputPins);
|
||||
tv_available_inputs = malloc(sizeof(long) * lInputPins);
|
||||
tv_available_inputs_count = 0;
|
||||
|
||||
mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: available video inputs:");
|
||||
@ -2063,11 +2063,11 @@ static HRESULT get_available_formats_stream(chain_t *chain)
|
||||
}
|
||||
done = 0;
|
||||
|
||||
arpmt = (AM_MEDIA_TYPE **) malloc((count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
arpmt = malloc((count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
if (arpmt) {
|
||||
memset(arpmt, 0, (count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
|
||||
pBuf = (void **) malloc((count + 1) * sizeof(void *));
|
||||
pBuf = malloc((count + 1) * sizeof(void *));
|
||||
if (pBuf) {
|
||||
memset(pBuf, 0, (count + 1) * sizeof(void *));
|
||||
|
||||
@ -2170,8 +2170,7 @@ static HRESULT get_available_formats_pin(ICaptureGraphBuilder2 * pBuilder,
|
||||
OLE_CALL(pEnum,Reset);
|
||||
|
||||
count = i;
|
||||
arpmt =
|
||||
(AM_MEDIA_TYPE **) malloc((count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
arpmt = malloc((count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
if (!arpmt)
|
||||
return E_OUTOFMEMORY;
|
||||
memset(arpmt, 0, (count + 1) * sizeof(AM_MEDIA_TYPE *));
|
||||
@ -2184,7 +2183,7 @@ static HRESULT get_available_formats_pin(ICaptureGraphBuilder2 * pBuilder,
|
||||
OLE_RELEASE_SAFE(pEnum);
|
||||
|
||||
|
||||
pBuf = (void **) malloc((count + 1) * sizeof(void *));
|
||||
pBuf = malloc((count + 1) * sizeof(void *));
|
||||
if (!pBuf) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (arpmt[i])
|
||||
|
@ -1660,7 +1660,7 @@ if ((suboverlap_enabled == 2) ||
|
||||
if (higher_line >= SUB_MAX_TEXT) {
|
||||
// the 'block' has too much lines, so we don't overlap the
|
||||
// subtitles
|
||||
second = (subtitle *) realloc(second, (sub_num + sub_to_add + 1) * sizeof(subtitle));
|
||||
second = realloc(second, (sub_num + sub_to_add + 1) * sizeof(subtitle));
|
||||
for (j = 0; j <= sub_to_add; ++j) {
|
||||
int ls;
|
||||
memset(&second[sub_num + j], '\0', sizeof(subtitle));
|
||||
@ -1680,7 +1680,7 @@ if ((suboverlap_enabled == 2) ||
|
||||
|
||||
// we read the placeholder structure and create the new
|
||||
// subs.
|
||||
second = (subtitle *) realloc(second, (sub_num + 1) * sizeof(subtitle));
|
||||
second = realloc(second, (sub_num + 1) * sizeof(subtitle));
|
||||
memset(&second[sub_num], '\0', sizeof(subtitle));
|
||||
second[sub_num].start = local_start;
|
||||
second[sub_num].end = local_end;
|
||||
|
Loading…
Reference in New Issue
Block a user