summaryrefslogtreecommitdiffstats
path: root/mpvcore/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:36:20 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:36:20 +0100
commit3486302514db31b8086f46226d9b46d53810d1e7 (patch)
treea5b35e0a67d4cee1b5ec8bb0d489f38495d66b3c /mpvcore/player/loadfile.c
parent057af4697cf65709012f41ff2f0d97b918c51d79 (diff)
downloadmpv-3486302514db31b8086f46226d9b46d53810d1e7.tar.bz2
mpv-3486302514db31b8086f46226d9b46d53810d1e7.tar.xz
video: move decoder context from sh_video into new struct
This is similar to the sh_audio commit. This is mostly cosmetic in nature, except that it also adds automatical freeing of the decoder driver's state struct (which was in sh_video->context, now in dec_video->priv). Also remove all the stheader.h fields that are not needed anymore.
Diffstat (limited to 'mpvcore/player/loadfile.c')
-rw-r--r--mpvcore/player/loadfile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mpvcore/player/loadfile.c b/mpvcore/player/loadfile.c
index 856f5469c0..51d3f2ec7e 100644
--- a/mpvcore/player/loadfile.c
+++ b/mpvcore/player/loadfile.c
@@ -99,8 +99,9 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
if (mask & INITIALIZED_VCODEC) {
mpctx->initialized_flags &= ~INITIALIZED_VCODEC;
- if (mpctx->sh_video)
- uninit_video(mpctx->sh_video);
+ if (mpctx->d_video)
+ video_uninit(mpctx->d_video);
+ mpctx->d_video = NULL;
cleanup_demux_stream(mpctx, STREAM_VIDEO);
mpctx->sync_audio_to_video = false;
}
@@ -113,7 +114,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
mpctx->num_tracks = 0;
for (int t = 0; t < STREAM_TYPE_COUNT; t++)
mpctx->current_track[t] = NULL;
- assert(!mpctx->sh_video && !mpctx->d_audio && !mpctx->sh_sub);
+ assert(!mpctx->d_video && !mpctx->d_audio && !mpctx->sh_sub);
mpctx->master_demuxer = NULL;
for (int i = 0; i < mpctx->num_sources; i++) {
uninit_subs(mpctx->sources[i]);
@@ -269,7 +270,6 @@ static void set_demux_field(struct MPContext *mpctx, enum stream_type type,
mpctx->sh[type] = s;
// redundant fields for convenience access
switch(type) {
- case STREAM_VIDEO: mpctx->sh_video = s ? s->video : NULL; break;
case STREAM_SUB: mpctx->sh_sub = s ? s->sub : NULL; break;
}
}
@@ -348,7 +348,7 @@ bool timeline_set_part(struct MPContext *mpctx, int i, bool force)
if (n->source == p->source && !force)
return false;
enum stop_play_reason orig_stop_play = mpctx->stop_play;
- if (!mpctx->sh_video && mpctx->stop_play == KEEP_PLAYING)
+ if (!mpctx->d_video && mpctx->stop_play == KEEP_PLAYING)
mpctx->stop_play = AT_END_OF_FILE; // let audio uninit drain data
uninit_player(mpctx, INITIALIZED_VCODEC | (mpctx->opts->fixed_vo ? 0 : INITIALIZED_VO) | (mpctx->opts->gapless_audio ? 0 : INITIALIZED_AO) | INITIALIZED_ACODEC | INITIALIZED_SUB);
mpctx->stop_play = orig_stop_play;
@@ -1050,7 +1050,7 @@ static void play_current_file(struct MPContext *mpctx)
assert(mpctx->stream == NULL);
assert(mpctx->demuxer == NULL);
assert(mpctx->d_audio == NULL);
- assert(mpctx->sh_video == NULL);
+ assert(mpctx->d_video == NULL);
assert(mpctx->sh_sub == NULL);
char *stream_filename = mpctx->filename;
@@ -1189,14 +1189,14 @@ goto_reopen_demuxer: ;
//================ SETUP STREAMS ==========================
- if (opts->force_fps && mpctx->sh_video) {
- mpctx->sh_video->fps = opts->force_fps;
- MP_INFO(mpctx, "FPS forced to be %5.3f.\n", mpctx->sh_video->fps);
+ if (opts->force_fps && mpctx->d_video) {
+ mpctx->d_video->header->video->fps = opts->force_fps;
+ MP_INFO(mpctx, "FPS forced to be %5.3f.\n", mpctx->d_video->header->video->fps);
}
//==================== START PLAYING =======================
- if (!mpctx->sh_video && !mpctx->d_audio) {
+ if (!mpctx->d_video && !mpctx->d_audio) {
MP_FATAL(mpctx, "No video or audio streams selected.\n");
#if HAVE_DVBIN
if (mpctx->stream->type == STREAMTYPE_DVB) {