[MPlayer-cvslog] r32648 - in trunk: command.c mp_core.h mplayer.c
reimar
subversion at mplayerhq.hu
Fri Nov 26 21:52:36 CET 2010
Author: reimar
Date: Fri Nov 26 21:52:35 2010
New Revision: 32648
Log:
build_afilter_chain is not safe to use directly, thus make it
static and instead use reinit_audio_chain which should have
better error handling.
Fixes a crash with -af hrtf and changing speed, audio will
still stop playing though.
Modified:
trunk/command.c
trunk/mp_core.h
trunk/mplayer.c
Modified: trunk/command.c
==============================================================================
--- trunk/command.c Thu Nov 25 11:04:07 2010 (r32647)
+++ trunk/command.c Fri Nov 26 21:52:35 2010 (r32648)
@@ -257,14 +257,14 @@ static int mp_property_playback_speed(m_
return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, *(float *) arg);
playback_speed = *(float *) arg;
- build_afilter_chain(mpctx->sh_audio, &ao_data);
+ reinit_audio_chain();
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
playback_speed += (arg ? *(float *) arg : 0.1) *
(action == M_PROPERTY_STEP_DOWN ? -1 : 1);
M_PROPERTY_CLAMP(prop, playback_speed);
- build_afilter_chain(mpctx->sh_audio, &ao_data);
+ reinit_audio_chain();
return M_PROPERTY_OK;
}
return m_property_float_range(prop, action, arg, &playback_speed);
@@ -2746,7 +2746,7 @@ int run_command(MPContext *mpctx, mp_cmd
case MP_CMD_SPEED_INCR:{
float v = cmd->args[0].v.f;
playback_speed += v;
- build_afilter_chain(sh_audio, &ao_data);
+ reinit_audio_chain();
set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
playback_speed);
} break;
@@ -2754,7 +2754,7 @@ int run_command(MPContext *mpctx, mp_cmd
case MP_CMD_SPEED_MULT:{
float v = cmd->args[0].v.f;
playback_speed *= v;
- build_afilter_chain(sh_audio, &ao_data);
+ reinit_audio_chain();
set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
playback_speed);
} break;
@@ -2762,7 +2762,7 @@ int run_command(MPContext *mpctx, mp_cmd
case MP_CMD_SPEED_SET:{
float v = cmd->args[0].v.f;
playback_speed = v;
- build_afilter_chain(sh_audio, &ao_data);
+ reinit_audio_chain();
set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
playback_speed);
} break;
@@ -3467,7 +3467,7 @@ int run_command(MPContext *mpctx, mp_cmd
else
af_add(mpctx->mixer.afilter, af_command);
}
- build_afilter_chain(sh_audio, &ao_data);
+ reinit_audio_chain();
free(af_args);
}
break;
@@ -3476,7 +3476,7 @@ int run_command(MPContext *mpctx, mp_cmd
break;
af_uninit(mpctx->mixer.afilter);
af_init(mpctx->mixer.afilter);
- build_afilter_chain(sh_audio, &ao_data);
+ reinit_audio_chain();
break;
case MP_CMD_AF_CMDLINE:
if (sh_audio) {
Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h Thu Nov 25 11:04:07 2010 (r32647)
+++ trunk/mp_core.h Fri Nov 26 21:52:35 2010 (r32648)
@@ -150,7 +150,6 @@ extern int fixed_vo;
extern int forced_subs_only;
-int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data);
void uninit_player(unsigned int mask);
void reinit_audio_chain(void);
void init_vo_spudec(void);
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Thu Nov 25 11:04:07 2010 (r32647)
+++ trunk/mplayer.c Fri Nov 26 21:52:35 2010 (r32648)
@@ -1334,7 +1334,7 @@ static void print_status(float a_pos, fl
* \param sh_audio describes the requested input format of the chain.
* \param ao_data describes the requested output format of the chain.
*/
-int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data)
+static int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data)
{
int new_srate;
int result;
More information about the MPlayer-cvslog
mailing list