summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ogg.c
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-29 17:25:39 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-29 17:25:39 +0000
commita2fad60c7f92299aa3cf51c85e0491167287c517 (patch)
tree2c54b256ed6a2e29a8ada1795cdede036d071416 /libmpdemux/demux_ogg.c
parent18fea2aa498664c20a603d9b4fb07ffbae2056c5 (diff)
downloadmpv-a2fad60c7f92299aa3cf51c85e0491167287c517.tar.bz2
mpv-a2fad60c7f92299aa3cf51c85e0491167287c517.tar.xz
Fill sh_sub_t.lang in lavf, mkv and ogg demuxers. Use it for printing subtitle
track language. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26116 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r--libmpdemux/demux_ogg.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 44816cf3bc..4b906c3da9 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -383,9 +383,13 @@ static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vor
// copy this language name into the array
index = demux_ogg_sub_reverse_id(d, id);
if (index >= 0) {
+ sh_sub_t* sh;
// in case of malicious files with more than one lang per track:
if (ogg_d->text_langs[index]) free(ogg_d->text_langs[index]);
ogg_d->text_langs[index] = strdup(val);
+ sh = d->s_streams[index];
+ if (sh && sh->lang) free(sh->lang);
+ if (sh) sh->lang = strdup(val);
}
// check for -slang if subs are uninitialized yet
if (os->text && d->sub->id < 0 && demux_ogg_check_lang(val, dvdsub_lang))
@@ -645,15 +649,6 @@ static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id) {
return -1;
}
-/** \brief Lookup the subtitle language by the subtitle number. Returns NULL on out-of-bounds input.
- * \param demuxer The demuxer about whose subtitles we are inquiring.
- * \param index The subtitle number.
- */
-const char *demux_ogg_sub_lang(demuxer_t *demuxer, int index) {
- ogg_demuxer_t *ogg_d = demuxer->priv;
- return (index < 0) ? NULL : (index >= ogg_d->n_text) ? NULL : ogg_d->text_langs[index];
-}
-
static void demux_close_ogg(demuxer_t* demuxer);
static void fixup_vorbis_wf(sh_audio_t *sh, ogg_demuxer_t *od)