Mercurial > mplayer.hg
changeset 20178:ce9587982eb5
Simplify mp_property_audio
author | reimar |
---|---|
date | Thu, 12 Oct 2006 18:03:28 +0000 |
parents | 761dffbe4cf0 |
children | be692800bc0c |
files | mplayer.c |
diffstat | 1 files changed, 9 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mplayer.c Thu Oct 12 17:39:39 2006 +0000 +++ b/mplayer.c Thu Oct 12 18:03:28 2006 +0000 @@ -1798,19 +1798,15 @@ return 1; case M_PROPERTY_PRINT: if(!arg) return 0; - *(char**)arg = malloc(64); - (*(char**)arg)[63] = 0; - - if (demuxer->type == DEMUXER_TYPE_MATROSKA && audio_id >= 0) { + + if (audio_id < 0) + *(char**)arg = strdup(MSGTR_Disabled); + else { char lang[40] = MSGTR_Unknown; + if (demuxer->type == DEMUXER_TYPE_MATROSKA) demux_mkv_get_audio_lang(demuxer, audio_id, lang, 9); - lang[39] = 0; - snprintf(*(char**)arg, 63, "(%d) %s", audio_id, lang); - return 1; - } #ifdef USE_DVDREAD - if (audio_id >= 0) { - char lang[3] = "\0\0\0"; + else { int code = 0; code = dvd_lang_from_aid(stream, audio_id); if (code) { @@ -1818,11 +1814,11 @@ lang[1] = code; lang[2] = 0; } - snprintf(*(char**)arg, 63, "(%d) %s", audio_id, code ? lang : MSGTR_Unknown); - return 1; } #endif - snprintf(*(char**)arg, 63, MSGTR_Disabled); + *(char**)arg = malloc(64); + snprintf(*(char**)arg, 64, "(%d) %s", audio_id, MSGTR_Unknown); + } return 1; case M_PROPERTY_STEP_UP: