summaryrefslogtreecommitdiffstats
path: root/mpvcore/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:22:17 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:22:17 +0100
commit0f5ec05d8f4ae02262dc79a895bce3b465b376f2 (patch)
treeba5fc3f640eeefa44a28695f8cd3f63ba2eec2c9 /mpvcore/player/video.c
parent705a7310e6c823a72c961720f8ae416962f1398a (diff)
downloadmpv-0f5ec05d8f4ae02262dc79a895bce3b465b376f2.tar.bz2
mpv-0f5ec05d8f4ae02262dc79a895bce3b465b376f2.tar.xz
audio: move decoder context from sh_audio into new struct
Move all state that basically changes during decoding or is needed in order to manage decoding itself into a new struct (dec_audio). sh_audio (defined in stheader.h) is supposed to be the audio stream header. This should reflect the file headers for the stream. Putting the decoder context there is strange design, to say the least.
Diffstat (limited to 'mpvcore/player/video.c')
-rw-r--r--mpvcore/player/video.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mpvcore/player/video.c b/mpvcore/player/video.c
index 66c6216d30..d55a19e79f 100644
--- a/mpvcore/player/video.c
+++ b/mpvcore/player/video.c
@@ -243,8 +243,8 @@ static int check_framedrop(struct MPContext *mpctx, double frame_time)
{
struct MPOpts *opts = mpctx->opts;
// check for frame-drop:
- if (mpctx->sh_audio && !mpctx->ao->untimed &&
- !demux_stream_eof(mpctx->sh_audio->gsh))
+ if (mpctx->d_audio && !mpctx->ao->untimed &&
+ !demux_stream_eof(mpctx->sh[STREAM_AUDIO]))
{
float delay = opts->playback_speed * ao_get_delay(mpctx->ao);
float d = delay - mpctx->delay;
@@ -314,7 +314,7 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx)
struct demux_packet *pkt = video_read_frame(mpctx);
if (!pkt)
return -1;
- if (mpctx->sh_audio)
+ if (mpctx->d_audio)
mpctx->delay -= frame_time;
// video_read_frame can change fps (e.g. for ASF video)
update_fps(mpctx);
@@ -469,7 +469,7 @@ double update_video(struct MPContext *mpctx, double endpts)
}
double frame_time = sh_video->pts - sh_video->last_pts;
sh_video->last_pts = sh_video->pts;
- if (mpctx->sh_audio)
+ if (mpctx->d_audio)
mpctx->delay -= frame_time;
return frame_time;
}