summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-22 19:06:21 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-24 12:16:00 +0900
commit4753a92b80307f90203c416c0307b035bdb97e21 (patch)
treeaefc5a9a9dda93801de60bb76de745bc1a1d43d8 /player/core.h
parent584a27e3b89657aa50f6efa7e766ad2903048183 (diff)
downloadmpv-4753a92b80307f90203c416c0307b035bdb97e21.tar.bz2
mpv-4753a92b80307f90203c416c0307b035bdb97e21.tar.xz
player: fix demuxer lifetime management
Commit f54220d9 attempted to improve this, but it got worse. Now there was a crash when ytdl_hook.lua added external tracks. This happened because close_unused_demuxers() assumed that sources[0] was the main demuxer (so that it didn't close it). This assumption failed, because the ytdl script can add external tracks before the main file is loaded. The easy fix would have been to check for master_demuxer, and not i==0. But instead give up on the old idea, make some stricter assumptions how demuxers and external tracks map, and simplify the code. (cherry picked from commit 53867aa9d834fd6a6314803655bd4c444d0e1df4)
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/core.h b/player/core.h
index 6909a2f712..74136f2bf9 100644
--- a/player/core.h
+++ b/player/core.h
@@ -180,7 +180,7 @@ typedef struct MPContext {
int64_t shown_vframes, shown_aframes;
struct stream *stream; // stream that was initially opened
- struct demuxer **sources;
+ struct demuxer **sources; // all open demuxers
int num_sources;
struct timeline *tl;
@@ -191,7 +191,7 @@ typedef struct MPContext {
int num_chapters;
double video_offset;
- struct demuxer *demuxer;
+ struct demuxer *demuxer; // can change with timeline
struct mp_tags *filtered_tags;
struct track **tracks;