mpv/libmpdemux
wm4 d21b109bf7 core: fix DVD subtitle selection
Add all subtitle tracks as reported by libdvdread at playback start.
Display language for subtitle and audio tracks. This commit restores
these features to the state when demux_mpg was default for DVD playback,
and makes them work with demux_lavf and the recent changes to subtitle
selection in the frontend.

demux_mpg, which was the default demuxer for DVD playback, reordered
the subtitle streams according to the "logical" subtitle track number,
which conforms to the track layout reported by libdvdread, and is what
stream_dvd expects for the STREAM_CTRL_GET_LANG call. demux_lavf, on
the other hand, adds the streams in the order it encounters them in
the MPEG stream. It seems this order is essentially random, and can't
be mapped easily to what stream_dvd expects.

Solve this by making demux_lavf hand out the MPEG stream IDs (using the
demuxer_id field). The MPEG IDs are mapped by mplayer.c by special
casing DVD playback (map_id_from/to_demuxer() functions). This mapping
is essentially the same what demux_mpg did. Making demux_lavf reorder
the streams is out of the question, because its stream handling is
already messy enough.

(Note that demux_lavf doesn't export stream IDs for other formats,
because most time libavformat demuxers do not set AVStream.id, and we
don't know which demuxers do. But we know that MPEG is safe.)

Another major complication is that subtitle tracks are added lazily, as
soon as the demuxer encounters the first subtitle packet for a given
subtitle stream. Add the streams in advance. If a yet non-existent
stream is selected, demux_lavf must be made to auto-select that subtitle
stream as soon as it is added. Otherwise, the first subtitle packet
would be lost. This is done by DEMUXER_CTRL_PRESELECT_SUBTITLE.
demux_mpg didn't need this: the frontend code could just set ds->id to
the desired stream number. But demux_lavf's stream IDs don't map
directly to the stream number as used by libdvdread, which is why this
hack is needed.
2012-09-18 21:04:45 +02:00
..
asf.h Change <endian.h> include to <sys/types.h> 2012-07-31 23:37:56 +02:00
asfguid.h
asfheader.c build: switch to libavutil bswap.h and intreadwrite.h 2012-02-01 22:46:27 +02:00
asfheader.h
aviheader.c aviheader.c: silence a warning 2012-02-29 02:49:48 +02:00
aviheader.h Change <endian.h> include to <sys/types.h> 2012-07-31 23:37:56 +02:00
aviprint.c
aviprint.h
demux_asf.c demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEY 2012-07-25 01:10:30 +03:00
demux_avi.c Remove some demuxers and decoders 2012-07-30 22:14:32 +02:00
demux_cue.c core: add new support for reading .cue files 2012-01-18 04:25:19 +01:00
demux_edl.c
demux_gif.c demux_gif: change format of packets to make it work again 2012-08-20 15:36:05 +02:00
demux_lavf.c core: fix DVD subtitle selection 2012-09-18 21:04:45 +02:00
demux_mf.c demux_mf: add j2c and jpc as jpeg2k, add tiff extension as tif image 2012-08-03 01:43:44 +02:00
demux_mkv.c demux_mkv: fix minor memory leak 2012-09-18 21:04:45 +02:00
demux_mng.c vd_ffmpeg, demux_mng: allow general raw formats, fix MNG demuxer 2012-08-20 15:36:04 +02:00
demux_packet.h demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEY 2012-07-25 01:10:30 +03:00
demux_rawaudio.c
demux_rawvideo.c
demuxer.c core: fix DVD subtitle selection 2012-09-18 21:04:45 +02:00
demuxer.h core: fix DVD subtitle selection 2012-09-18 21:04:45 +02:00
ebml.c Update Libav API uses 2012-02-01 22:46:27 +02:00
ebml.h
extension.c libmpdemux: remove demux_real, demux_viv, demux_audio 2012-08-20 15:36:02 +02:00
matroska.h
mf.c windows support: unicode filenames 2012-03-09 20:48:54 +02:00
mf.h
mp_taglists.c demux_lavf: use Libav RIFF tag lists directly 2012-02-01 22:46:27 +02:00
mp_taglists.h demux_lavf: use Libav RIFF tag lists directly 2012-02-01 22:46:27 +02:00
ms_hdr.h Change <endian.h> include to <sys/types.h> 2012-07-31 23:37:56 +02:00
stheader.h core: manage tracks in the frontend 2012-09-18 21:04:45 +02:00
video.c Remove support for LIVE555 RTSP streaming 2012-08-20 15:36:03 +02:00