[Mplayer-cvslog] CVS: main mixer.c,1.17,1.18
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Wed Jul 28 14:17:51 CEST 2004
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv10545
Modified Files:
mixer.c
Log Message:
automatic loading of af_volume, original patch by Dan Christiansen (danchr (at) daimi (dot) au (dot) dk)
Index: mixer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- mixer.c 26 Jun 2004 12:47:00 -0000 1.17
+++ mixer.c 28 Jul 2004 12:17:48 -0000 1.18
@@ -28,7 +28,8 @@
float db_vals[AF_NCH];
if (!af_control_any_rev(mixer->afilter,
AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_GET, db_vals))
- return;
+ db_vals[0] = db_vals[1] = 1.0;
+ else
af_from_dB (2, db_vals, db_vals, 20.0, -200.0, 60.0);
vol.left = db_vals[0] * 90.0;
vol.right = db_vals[1] * 90.0;
@@ -61,8 +62,14 @@
af_to_dB (AF_NCH, db_vals, db_vals, 20.0);
if (!af_control_any_rev(mixer->afilter,
AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, db_vals)) {
- mp_msg(MSGT_GLOBAL, MSGL_HINT, MSGTR_NeedAfVolume);
- return;
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, MSGTR_InsertingAfVolume);
+ if (af_add(mixer->afilter, "volume")) {
+ if (!af_control_any_rev(mixer->afilter,
+ AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, db_vals)) {
+ mp_msg(MSGT_GLOBAL, MSGL_ERR, MSGTR_NoVolume);
+ return;
+ }
+ }
}
}
}
More information about the MPlayer-cvslog
mailing list