Mercurial > mplayer.hg
diff command.c @ 31877:e30fe0cb79cd
Add incomplete clipinf reading support to display audio
and subtitle languages and make -alang and -slang work.
author | reimar |
---|---|
date | Wed, 11 Aug 2010 20:59:03 +0000 |
parents | 05ca6dd36faf |
children | f8af1068e397 |
line wrap: on
line diff
--- a/command.c Wed Aug 11 20:44:29 2010 +0000 +++ b/command.c Wed Aug 11 20:59:03 2010 +0000 @@ -53,6 +53,7 @@ #ifdef CONFIG_DVBIN #include "stream/dvbin.h" #endif +#include "stream/stream_bd.h" #ifdef CONFIG_DVDREAD #include "stream/stream_dvd.h" #endif @@ -899,6 +900,12 @@ sh_audio_t* sh = mpctx->sh_audio; if (sh && sh->lang) av_strlcpy(lang, sh->lang, 40); + // TODO: use a proper STREAM_CTRL instead of this mess + else if (sh && mpctx->stream->type == STREAMTYPE_BD) { + const char *l = bd_lang_from_id(mpctx->stream, sh->aid); + if (l) + av_strlcpy(lang, l, sizeof(lang)); + } #ifdef CONFIG_DVDREAD else if (mpctx->stream->type == STREAMTYPE_DVD) { int code = dvd_lang_from_aid(mpctx->stream, current_id); @@ -1440,6 +1447,14 @@ } #endif + if (mpctx->stream->type == STREAMTYPE_BD + && d_sub && d_sub->sh && dvdsub_id >= 0) { + const char *lang = bd_lang_from_id(mpctx->stream, ((sh_sub_t*)d_sub->sh)->sid); + if (!lang) lang = MSGTR_Unknown; + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); + return M_PROPERTY_OK; + } + if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA || mpctx->demuxer->type == DEMUXER_TYPE_LAVF || mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED