summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-21 22:24:20 +0100
committerwm4 <wm4@nowhere>2016-01-22 00:25:44 +0100
commit7bb9203f7fec1ad4e40a7ae58d68b604c0a4565e (patch)
tree6454f416b7ef2c5612ba1b4bdc66a0839530e1f5 /player/command.c
parentfef8b7984be5a6244612d346bd60d2badd4a2e63 (diff)
downloadmpv-7bb9203f7fec1ad4e40a7ae58d68b604c0a4565e.tar.bz2
mpv-7bb9203f7fec1ad4e40a7ae58d68b604c0a4565e.tar.xz
player: refactor: eliminate MPContext.d_audio
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 52f0b1830f..5be8c2d120 100644
--- a/player/command.c
+++ b/player/command.c
@@ -536,7 +536,7 @@ static int mp_property_avsync(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- if (!mpctx->d_audio || !mpctx->vo_chain)
+ if (!mpctx->ao_chain || !mpctx->vo_chain)
return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_PRINT) {
*(char **)arg = talloc_asprintf(NULL, "%7.3f", mpctx->last_av_difference);
@@ -549,7 +549,7 @@ static int mp_property_total_avsync_change(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- if (!mpctx->d_audio || !mpctx->vo_chain)
+ if (!mpctx->ao_chain || !mpctx->vo_chain)
return M_PROPERTY_UNAVAILABLE;
if (mpctx->total_avsync_change == MP_NOPTS_VALUE)
return M_PROPERTY_UNAVAILABLE;
@@ -1696,7 +1696,7 @@ static int mp_property_audio_delay(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- if (!(mpctx->d_audio && mpctx->vo_chain))
+ if (!(mpctx->ao_chain && mpctx->vo_chain))
return M_PROPERTY_UNAVAILABLE;
float delay = mpctx->opts->audio_delay;
switch (action) {
@@ -1716,7 +1716,8 @@ static int mp_property_audio_codec_name(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- const char *c = mpctx->d_audio ? mpctx->d_audio->header->codec->codec : NULL;
+ struct track *track = mpctx->current_track[0][STREAM_AUDIO];
+ const char *c = track && track->stream ? track->stream->codec->codec : NULL;
return m_property_strdup_ro(action, arg, c);
}
@@ -1725,7 +1726,8 @@ static int mp_property_audio_codec(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- const char *c = mpctx->d_audio ? mpctx->d_audio->decoder_desc : NULL;
+ struct track *track = mpctx->current_track[0][STREAM_AUDIO];
+ const char *c = track && track->d_audio ? track->d_audio->decoder_desc : NULL;
return m_property_strdup_ro(action, arg, c);
}