annotate libaf/af_dummy.c @ 26697:baaeace9c6a8

MPlayer uses Subversion, not GIT, 10L to me, and thanks to Mizda for spotting this
author gpoirier
date Sun, 11 May 2008 08:54:44 +0000
parents b2402b4f0afa
children 72d0b1444141
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
1 /* The name speaks for itself this filter is a dummy and will not blow
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
2 up regardless of what you do with it. */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
3 #include <stdio.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
4 #include <stdlib.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
5 #include <string.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
6
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
7 #include "af.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
8
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
9 // Initialization and runtime control
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
10 static int control(struct af_instance_s* af, int cmd, void* arg)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
11 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
12 switch(cmd){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
13 case AF_CONTROL_REINIT:
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
14 memcpy(af->data,(af_data_t*)arg,sizeof(af_data_t));
14816
ca769ef8645e better infoline
alex
parents: 8167
diff changeset
15 af_msg(AF_MSG_VERBOSE,"[dummy] Was reinitialized: %iHz/%ich/%s\n",
ca769ef8645e better infoline
alex
parents: 8167
diff changeset
16 af->data->rate,af->data->nch,af_fmt2str_short(af->data->format));
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
17 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
18 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
19 return AF_UNKNOWN;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
20 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
21
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
22 // Deallocate memory
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
23 static void uninit(struct af_instance_s* af)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
24 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
25 if(af->data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
26 free(af->data);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
27 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
28
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
29 // Filter data through filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
30 static af_data_t* play(struct af_instance_s* af, af_data_t* data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
31 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
32 // Do something necessary to get rid of annoying warning during compile
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
33 if(!af)
8167
e8832e66babd New features:
anders
parents: 7615
diff changeset
34 af_msg(AF_MSG_ERROR,"EEEK: Argument af == NULL in af_dummy.c play().");
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
35 return data;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
36 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
37
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
38 // Allocate memory and set function pointers
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 14816
diff changeset
39 static int af_open(af_instance_t* af){
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
40 af->control=control;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
41 af->uninit=uninit;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
42 af->play=play;
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 22746
diff changeset
43 af->mul=1;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
44 af->data=malloc(sizeof(af_data_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
45 if(af->data == NULL)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
46 return AF_ERROR;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
47 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
48 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
49
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
50 // Description of this filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
51 af_info_t af_info_dummy = {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
52 "dummy",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
53 "dummy",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
54 "Anders",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
55 "",
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7568
diff changeset
56 AF_FLAGS_REENTRANT,
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 14816
diff changeset
57 af_open
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
58 };