diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-01 09:48:34 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-01 09:48:34 +0000 |
commit | 1280614c9f3dd85ba1fa2f19f0b4d40f011bb8ee (patch) | |
tree | 3231aa2fa32d38100e90c914926671c396d5ba4b /libmpdemux | |
parent | e9942166df28c0ae14566eab9d7a7e6011faafab (diff) |
Unbreak the demuxer-specific code in video.c with e.g.
-audiofile by moving the code to manually interleave
subtitles to mp_common.c.
video.c should still be changed to not be demuxer-specific
anymore, it is bad practice but fully fixing it is non-trivial.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29810 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_demuxers.c | 6 | ||||
-rw-r--r-- | libmpdemux/demuxer.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libmpdemux/demux_demuxers.c b/libmpdemux/demux_demuxers.c index 4cfc59edb9..9c13ed7304 100644 --- a/libmpdemux/demux_demuxers.c +++ b/libmpdemux/demux_demuxers.c @@ -54,9 +54,15 @@ demuxer_t* new_demuxers_demuxer(demuxer_t* vd, demuxer_t* ad, demuxer_t* sd) { ret->video = vd->video; ret->audio = ad->audio; ret->sub = sd->sub; + if (sd && sd != vd && sd != ad) sd->sub->non_interleaved = 1; + + // without these, demux_demuxers_fill_buffer will never be called, + // but they break the demuxer-specific code in video.c +#if 0 if (vd) vd->video->demuxer = ret; if (ad) ad->audio->demuxer = ret; if (sd) sd->sub->demuxer = ret; +#endif // HACK?, necessary for subtitle (and audio and video when implemented) switching memcpy(ret->v_streams, vd->v_streams, sizeof(ret->v_streams)); diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 77b20e1bcf..5d62f1bb52 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -142,6 +142,8 @@ typedef struct { off_t dpos; // position in the demuxed stream int pack_no; // serial number of packet int flags; // flags of current packet (keyframe etc) + int non_interleaved; // 1 if this stream is not properly interleaved, + // so e.g. subtitle handling must do explicit reads. //--------------- int packs; // number of packets in buffer int bytes; // total bytes of packets in buffer |