diff options
author | mosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-18 08:37:21 +0000 |
---|---|---|
committer | mosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-18 08:37:21 +0000 |
commit | e8a1b371302278226a011eb45490d0542bbc6ae3 (patch) | |
tree | b35357a0ce3c6e7222b9bd9f35807a9f24b40aa8 /libmpdemux | |
parent | 0dfbe88178a285a572d5dd5bb74f9fcd72dcbbe6 (diff) |
Parse comma separated language lists instead of comparing the complete language string. Patch by Loren Merritt <lorenm at u dot washington dot edu>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12042 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mkv.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index 18863ff93d..d4ce3bc04e 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -236,12 +236,19 @@ demux_mkv_find_track_by_num (mkv_demuxer_t *d, int n, int type) static mkv_track_t * demux_mkv_find_track_by_language (mkv_demuxer_t *d, char *language, int type) { - int i; + int i, len; - for (i=0; i < d->num_tracks; i++) - if (d->tracks[i] != NULL && d->tracks[i]->language != NULL && - d->tracks[i]->type == type && !strcmp(d->tracks[i]->language,language)) - return d->tracks[i]; + language += strspn(language,","); + while((len = strcspn(language,",")) > 0) + { + for (i=0; i < d->num_tracks; i++) + if (d->tracks[i] != NULL && d->tracks[i]->language != NULL && + d->tracks[i]->type == type && + !strncmp(d->tracks[i]->language, language, len)) + return d->tracks[i]; + language += len; + language += strspn(language,","); + } return NULL; } |