diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-03 20:41:46 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-03 20:41:46 +0300 |
commit | 8ff5b2b88930146fb1931ead243703754e227709 (patch) | |
tree | b7b5b83dd3435573a6ac0a589ba42532e9de3b0f /libmpdemux/demux_lavf.c | |
parent | c5364305bec6dff4566b988157b93d3d171465e3 (diff) | |
download | mpv-8ff5b2b88930146fb1931ead243703754e227709.tar.bz2 mpv-8ff5b2b88930146fb1931ead243703754e227709.tar.xz |
OSD: when switching sub/audio tracks show title of new track
If the played file has per-track titles for audio and subtitles show
those on the OSD when switching tracks. This changes the OSD message
from 'Audio: (2) eng' to 'Audio: (2) eng ("Director's commentary")'.
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r-- | libmpdemux/demux_lavf.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index e8313fa4c2..73174437fb 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -362,9 +362,11 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) sh_audio->format = 0x7; break; } - if (title && title->value) + if (title && title->value) { + sh_audio->title = talloc_strdup(sh_audio, title->value); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_NAME=%s\n", priv->audio_streams, title->value); + } if (lang && lang->value) { sh_audio->lang = talloc_strdup(sh_audio, lang->value); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", @@ -425,9 +427,11 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) sh_video->aspect = codec->width * codec->sample_aspect_ratio.num / (float)(codec->height * codec->sample_aspect_ratio.den); sh_video->i_bps = codec->bit_rate / 8; - if (title && title->value) + if (title && title->value) { + sh_video->title = talloc_strdup(sh_video, title->value); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_NAME=%s\n", priv->video_streams, title->value); + } mp_msg(MSGT_DEMUX, MSGL_DBG2, "aspect= %d*%d/(%d*%d)\n", codec->width, codec->sample_aspect_ratio.num, codec->height, codec->sample_aspect_ratio.den); @@ -480,9 +484,11 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) memcpy(sh_sub->extradata, codec->extradata, codec->extradata_size); sh_sub->extradata_len = codec->extradata_size; } - if (title && title->value) + if (title && title->value) { + sh_sub->title = talloc_strdup(sh_sub, title->value); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_NAME=%s\n", priv->sub_streams, title->value); + } if (lang && lang->value) { sh_sub->lang = talloc_strdup(sh_sub, lang->value); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", |