path: root/player/sub.c
diff options
authorwm4 <wm4@nowhere>2016-01-17 18:07:50 +0100
committerwm4 <wm4@nowhere>2016-01-17 18:38:07 +0100
commit4195a345a51e52337bc972aacbce0fd6e88ebb5d (patch)
tree267a57310fffe943845d7ce2058447ccd7f7458d /player/sub.c
parent004bc9526308c6bc3f51591423e88bb1adaff167 (diff)
player: refactor: eliminate MPContext.d_video
Eventually we want the VO be driven by a A->V filter, so a decoder doesn't even have to exist. Some features definitely require a decoder though (like reporting the decoder in use, hardware decoding, etc.), so for each thing which accessed d_video, it has to be redecided if and how it can access decoder state. At least the "framedrop" property slightly changes semantics: you can now always set this property, even if no video is active. Some untested changes in this commit, but our bio-based distributed test suite has to take care of this.
Diffstat (limited to 'player/sub.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/player/sub.c b/player/sub.c
index 6635ef98fb..6e707b3d95 100644
--- a/player/sub.c
+++ b/player/sub.c
@@ -135,8 +135,9 @@ static bool init_subdec(struct MPContext *mpctx, struct track *track)
if (!track->d_sub)
return false;
+ struct track *vtrack = mpctx->current_track[0][STREAM_VIDEO];
struct mp_codec_params *v_c =
- mpctx->d_video ? mpctx->d_video->header->codec : NULL;
+ vtrack && vtrack->stream ? vtrack->stream->codec : NULL;
double fps = v_c ? v_c->fps : 25;
sub_control(track->d_sub, SD_CTRL_SET_VIDEO_DEF_FPS, &fps);