comparison 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
comparison
equal deleted inserted replaced
31876:c52e80f24086 31877:e30fe0cb79cd
51 #include "stream/stream_radio.h" 51 #include "stream/stream_radio.h"
52 #include "stream/pvr.h" 52 #include "stream/pvr.h"
53 #ifdef CONFIG_DVBIN 53 #ifdef CONFIG_DVBIN
54 #include "stream/dvbin.h" 54 #include "stream/dvbin.h"
55 #endif 55 #endif
56 #include "stream/stream_bd.h"
56 #ifdef CONFIG_DVDREAD 57 #ifdef CONFIG_DVDREAD
57 #include "stream/stream_dvd.h" 58 #include "stream/stream_dvd.h"
58 #endif 59 #endif
59 #include "stream/stream_dvdnav.h" 60 #include "stream/stream_dvdnav.h"
60 #include "libass/ass_mp.h" 61 #include "libass/ass_mp.h"
897 else { 898 else {
898 char lang[40] = MSGTR_Unknown; 899 char lang[40] = MSGTR_Unknown;
899 sh_audio_t* sh = mpctx->sh_audio; 900 sh_audio_t* sh = mpctx->sh_audio;
900 if (sh && sh->lang) 901 if (sh && sh->lang)
901 av_strlcpy(lang, sh->lang, 40); 902 av_strlcpy(lang, sh->lang, 40);
903 // TODO: use a proper STREAM_CTRL instead of this mess
904 else if (sh && mpctx->stream->type == STREAMTYPE_BD) {
905 const char *l = bd_lang_from_id(mpctx->stream, sh->aid);
906 if (l)
907 av_strlcpy(lang, l, sizeof(lang));
908 }
902 #ifdef CONFIG_DVDREAD 909 #ifdef CONFIG_DVDREAD
903 else if (mpctx->stream->type == STREAMTYPE_DVD) { 910 else if (mpctx->stream->type == STREAMTYPE_DVD) {
904 int code = dvd_lang_from_aid(mpctx->stream, current_id); 911 int code = dvd_lang_from_aid(mpctx->stream, current_id);
905 if (code) { 912 if (code) {
906 lang[0] = code >> 8; 913 lang[0] = code >> 8;
1437 return M_PROPERTY_OK; 1444 return M_PROPERTY_OK;
1438 } 1445 }
1439 } 1446 }
1440 } 1447 }
1441 #endif 1448 #endif
1449
1450 if (mpctx->stream->type == STREAMTYPE_BD
1451 && d_sub && d_sub->sh && dvdsub_id >= 0) {
1452 const char *lang = bd_lang_from_id(mpctx->stream, ((sh_sub_t*)d_sub->sh)->sid);
1453 if (!lang) lang = MSGTR_Unknown;
1454 snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
1455 return M_PROPERTY_OK;
1456 }
1442 1457
1443 if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA 1458 if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA
1444 || mpctx->demuxer->type == DEMUXER_TYPE_LAVF 1459 || mpctx->demuxer->type == DEMUXER_TYPE_LAVF
1445 || mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED 1460 || mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED
1446 || mpctx->demuxer->type == DEMUXER_TYPE_OGG) 1461 || mpctx->demuxer->type == DEMUXER_TYPE_OGG)