From d0bfe9916c205bf8d901c8547b0381211c4df757 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 10:30:49 +0000 Subject: Save DVDNAV palette info. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27005 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 1 + stream/stream_dvdnav.h | 1 + 2 files changed, 2 insertions(+) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 633ff65b45..1b169cabd0 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -823,6 +823,7 @@ void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl) { hl->sy = hlev.sy; hl->ex = hlev.ex; hl->ey = hlev.ey; + hl->palette = hlev.palette; } void mp_dvdnav_switch_title (stream_t *stream, int title) { diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index ddd5700e16..89e38968a0 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -13,6 +13,7 @@ typedef struct { typedef struct { uint16_t sx, sy; uint16_t ex, ey; + uint32_t palette; } nav_highlight_t; int dvdnav_number_of_subs(stream_t *stream); -- cgit v1.2.3 From a5d9a2b2b0d9aa74d0f0bdcd5996b3dfb40283c5 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 12:37:32 +0000 Subject: Add routine to determine if audio has changed in dvdnav stream. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27015 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 24 ++++++++++++++++++++++++ stream/stream_dvdnav.h | 1 + 2 files changed, 25 insertions(+) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 1b169cabd0..0d3eedacf5 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -31,6 +31,7 @@ typedef enum { NAV_FLAG_VTS_DOMAIN = 1 << 6, /* vts domain */ NAV_FLAG_SPU_SET = 1 << 7, /* spu_clut is valid */ NAV_FLAG_STREAM_CHANGE = 1 << 8, /* title, chapter, audio or SPU */ + NAV_FLAG_AUDIO_CHANGE = 1 << 9, /* audio stream change event */ } dvdnav_state_t; typedef struct { @@ -332,6 +333,7 @@ static int fill_buffer(stream_t *s, char *but, int len) dvdnav_vts_change_event_t *vts_event = (dvdnav_vts_change_event_t *)s->buffer; mp_msg(MSGT_CPLAYER,MSGL_INFO, "DVDNAV, switched to title: %d\r\n", vts_event->new_vtsN); priv->state |= NAV_FLAG_CELL_CHANGED; + priv->state |= NAV_FLAG_AUDIO_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; priv->state &= ~NAV_FLAG_WAIT; s->end_pos = 0; @@ -348,6 +350,7 @@ static int fill_buffer(stream_t *s, char *but, int len) } case DVDNAV_CELL_CHANGE: { priv->state |= NAV_FLAG_CELL_CHANGED; + priv->state |= NAV_FLAG_AUDIO_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; priv->state &= ~NAV_FLAG_WAIT; if (priv->state & NAV_FLAG_WAIT_READ_AUTO) @@ -360,6 +363,9 @@ static int fill_buffer(stream_t *s, char *but, int len) dvdnav_get_highlight (priv, 1); } break; + case DVDNAV_AUDIO_STREAM_CHANGE: + priv->state |= NAV_FLAG_AUDIO_CHANGE; + break; } } mp_msg(MSGT_STREAM,MSGL_DBG2,"DVDNAV fill_buffer len: %d\n",len); @@ -906,6 +912,24 @@ int mp_dvdnav_cell_has_changed (stream_t *stream, int clear) { return 1; } +/** + * \brief Check if audio has changed + * \param stream: - stream pointer + * \param clear : - if true, then clear audio change flag + * \return 1 if audio has changed + */ +int mp_dvdnav_audio_has_changed (stream_t *stream, int clear) { + dvdnav_priv_t *priv = stream->priv; + + if (!(priv->state & NAV_FLAG_AUDIO_CHANGE)) + return 0; + + if (clear) + priv->state &= ~NAV_FLAG_AUDIO_CHANGE; + + return 1; +} + /* Notify if something has changed in stream * Can be related to title, chapter, audio or SPU */ diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index 89e38968a0..7185acaa59 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -31,6 +31,7 @@ int mp_dvdnav_skip_still (stream_t *stream); int mp_dvdnav_skip_wait (stream_t *stream); void mp_dvdnav_read_wait (stream_t *stream, int mode, int automode); int mp_dvdnav_cell_has_changed (stream_t *stream, int clear); +int mp_dvdnav_audio_has_changed (stream_t *stream, int clear); int mp_dvdnav_stream_has_changed (stream_t *stream); #endif /* MPLAYER_STREAM_DVDNAV_H */ -- cgit v1.2.3 From c655b2d499728a4871b4f68c4d0245fce322bdb5 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 12:42:00 +0000 Subject: Add routine to determine if SPU has changed in dvdnav stream. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27016 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 24 ++++++++++++++++++++++++ stream/stream_dvdnav.h | 1 + 2 files changed, 25 insertions(+) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 0d3eedacf5..6734a388ea 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -32,6 +32,7 @@ typedef enum { NAV_FLAG_SPU_SET = 1 << 7, /* spu_clut is valid */ NAV_FLAG_STREAM_CHANGE = 1 << 8, /* title, chapter, audio or SPU */ NAV_FLAG_AUDIO_CHANGE = 1 << 9, /* audio stream change event */ + NAV_FLAG_SPU_CHANGE = 1 << 10, /* spu stream change event */ } dvdnav_state_t; typedef struct { @@ -334,6 +335,7 @@ static int fill_buffer(stream_t *s, char *but, int len) mp_msg(MSGT_CPLAYER,MSGL_INFO, "DVDNAV, switched to title: %d\r\n", vts_event->new_vtsN); priv->state |= NAV_FLAG_CELL_CHANGED; priv->state |= NAV_FLAG_AUDIO_CHANGE; + priv->state |= NAV_FLAG_SPU_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; priv->state &= ~NAV_FLAG_WAIT; s->end_pos = 0; @@ -351,6 +353,7 @@ static int fill_buffer(stream_t *s, char *but, int len) case DVDNAV_CELL_CHANGE: { priv->state |= NAV_FLAG_CELL_CHANGED; priv->state |= NAV_FLAG_AUDIO_CHANGE; + priv->state |= NAV_FLAG_SPU_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; priv->state &= ~NAV_FLAG_WAIT; if (priv->state & NAV_FLAG_WAIT_READ_AUTO) @@ -366,6 +369,9 @@ static int fill_buffer(stream_t *s, char *but, int len) case DVDNAV_AUDIO_STREAM_CHANGE: priv->state |= NAV_FLAG_AUDIO_CHANGE; break; + case DVDNAV_SPU_STREAM_CHANGE: + priv->state |= NAV_FLAG_SPU_CHANGE; + break; } } mp_msg(MSGT_STREAM,MSGL_DBG2,"DVDNAV fill_buffer len: %d\n",len); @@ -930,6 +936,24 @@ int mp_dvdnav_audio_has_changed (stream_t *stream, int clear) { return 1; } +/** + * \brief Check if SPU has changed + * \param stream: - stream pointer + * \param clear : - if true, then clear spu change flag + * \return 1 if spu has changed + */ +int mp_dvdnav_spu_has_changed (stream_t *stream, int clear) { + dvdnav_priv_t *priv = stream->priv; + + if (!(priv->state & NAV_FLAG_SPU_CHANGE)) + return 0; + + if (clear) + priv->state &= ~NAV_FLAG_SPU_CHANGE; + + return 1; +} + /* Notify if something has changed in stream * Can be related to title, chapter, audio or SPU */ diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index 7185acaa59..ff9c1796ef 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -32,6 +32,7 @@ int mp_dvdnav_skip_wait (stream_t *stream); void mp_dvdnav_read_wait (stream_t *stream, int mode, int automode); int mp_dvdnav_cell_has_changed (stream_t *stream, int clear); int mp_dvdnav_audio_has_changed (stream_t *stream, int clear); +int mp_dvdnav_spu_has_changed (stream_t *stream, int clear); int mp_dvdnav_stream_has_changed (stream_t *stream); #endif /* MPLAYER_STREAM_DVDNAV_H */ -- cgit v1.2.3 From 51880f90296668609dd999b7818632760701f357 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 12:42:40 +0000 Subject: rename for consistency git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27017 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 6734a388ea..e6d2ef2266 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -25,7 +25,7 @@ typedef enum { NAV_FLAG_EOF = 1 << 0, /* end of stream has been reached */ NAV_FLAG_WAIT = 1 << 1, /* wait event */ NAV_FLAG_WAIT_SKIP = 1 << 2, /* wait skip disable */ - NAV_FLAG_CELL_CHANGED = 1 << 3, /* cell change event */ + NAV_FLAG_CELL_CHANGE = 1 << 3, /* cell change event */ NAV_FLAG_WAIT_READ_AUTO = 1 << 4, /* wait read auto mode */ NAV_FLAG_WAIT_READ = 1 << 5, /* suspend read from stream */ NAV_FLAG_VTS_DOMAIN = 1 << 6, /* vts domain */ @@ -333,7 +333,7 @@ static int fill_buffer(stream_t *s, char *but, int len) int tit = 0, part = 0; dvdnav_vts_change_event_t *vts_event = (dvdnav_vts_change_event_t *)s->buffer; mp_msg(MSGT_CPLAYER,MSGL_INFO, "DVDNAV, switched to title: %d\r\n", vts_event->new_vtsN); - priv->state |= NAV_FLAG_CELL_CHANGED; + priv->state |= NAV_FLAG_CELL_CHANGE; priv->state |= NAV_FLAG_AUDIO_CHANGE; priv->state |= NAV_FLAG_SPU_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; @@ -351,7 +351,7 @@ static int fill_buffer(stream_t *s, char *but, int len) break; } case DVDNAV_CELL_CHANGE: { - priv->state |= NAV_FLAG_CELL_CHANGED; + priv->state |= NAV_FLAG_CELL_CHANGE; priv->state |= NAV_FLAG_AUDIO_CHANGE; priv->state |= NAV_FLAG_SPU_CHANGE; priv->state &= ~NAV_FLAG_WAIT_SKIP; @@ -909,10 +909,10 @@ void mp_dvdnav_read_wait (stream_t *stream, int mode, int automode) { */ int mp_dvdnav_cell_has_changed (stream_t *stream, int clear) { dvdnav_priv_t *priv = stream->priv; - if (!(priv->state & NAV_FLAG_CELL_CHANGED)) + if (!(priv->state & NAV_FLAG_CELL_CHANGE)) return 0; if (clear) { - priv->state &= ~NAV_FLAG_CELL_CHANGED; + priv->state &= ~NAV_FLAG_CELL_CHANGE; priv->state |= NAV_FLAG_STREAM_CHANGE; } return 1; -- cgit v1.2.3 From c71d348a7df75558c1092ccd446989de347ff09d Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 12:57:23 +0000 Subject: Rename some functions as they are mplayer related and not from libdvdnav public API. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27018 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 20 ++++++++++---------- stream/stream_dvdnav.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index e6d2ef2266..080913baca 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -682,12 +682,12 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but } /** - * \brief dvdnav_aid_from_lang() returns the audio id corresponding to the language code 'lang' + * \brief mp_dvdnav_aid_from_lang() returns the audio id corresponding to the language code 'lang' * \param stream: - stream pointer * \param lang: 2-characters language code[s], eventually separated by spaces of commas * \return -1 on error, current subtitle id if successful */ -int dvdnav_aid_from_lang(stream_t *stream, unsigned char *language) { +int mp_dvdnav_aid_from_lang(stream_t *stream, unsigned char *language) { dvdnav_priv_t * priv = stream->priv; int k; uint8_t format, lg; @@ -722,13 +722,13 @@ int dvdnav_aid_from_lang(stream_t *stream, unsigned char *language) { } /** - * \brief dvdnav_lang_from_aid() assigns to buf the language corresponding to audio id 'aid' + * \brief mp_dvdnav_lang_from_aid() assigns to buf the language corresponding to audio id 'aid' * \param stream: - stream pointer * \param sid: physical subtitle id * \param buf: buffer to contain the 2-chars language string * \return 0 on error, 1 if successful */ -int dvdnav_lang_from_aid(stream_t *stream, int aid, unsigned char *buf) { +int mp_dvdnav_lang_from_aid(stream_t *stream, int aid, unsigned char *buf) { uint8_t lg; uint16_t lang; dvdnav_priv_t * priv = stream->priv; @@ -747,12 +747,12 @@ int dvdnav_lang_from_aid(stream_t *stream, int aid, unsigned char *buf) { /** - * \brief dvdnav_sid_from_lang() returns the subtitle id corresponding to the language code 'lang' + * \brief mp_dvdnav_sid_from_lang() returns the subtitle id corresponding to the language code 'lang' * \param stream: - stream pointer * \param lang: 2-characters language code[s], eventually separated by spaces of commas * \return -1 on error, current subtitle id if successful */ -int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) { +int mp_dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) { dvdnav_priv_t * priv = stream->priv; uint8_t lg, k; uint16_t lang, lcode; @@ -774,13 +774,13 @@ int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) { } /** - * \brief dvdnav_lang_from_sid() assigns to buf the language corresponding to subtitle id 'sid' + * \brief mp_dvdnav_lang_from_sid() assigns to buf the language corresponding to subtitle id 'sid' * \param stream: - stream pointer * \param sid: physical subtitle id * \param buf: buffer to contain the 2-chars language string * \return 0 on error, 1 if successful */ -int dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf) { +int mp_dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf) { uint8_t lg; uint16_t lang; dvdnav_priv_t *priv = stream->priv; @@ -795,11 +795,11 @@ int dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf) { } /** - * \brief dvdnav_number_of_subs() returns the count of available subtitles + * \brief mp_dvdnav_number_of_subs() returns the count of available subtitles * \param stream: - stream pointer * \return 0 on error, something meaningful otherwise */ -int dvdnav_number_of_subs(stream_t *stream) { +int mp_dvdnav_number_of_subs(stream_t *stream) { dvdnav_priv_t * priv = stream->priv; uint8_t lg, k, n=0; diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index ff9c1796ef..6c155c7563 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -16,11 +16,11 @@ typedef struct { uint32_t palette; } nav_highlight_t; -int dvdnav_number_of_subs(stream_t *stream); -int dvdnav_aid_from_lang(stream_t *stream, unsigned char *language); -int dvdnav_lang_from_aid(stream_t *stream, int id, unsigned char *buf); -int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language); -int dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf); +int mp_dvdnav_number_of_subs(stream_t *stream); +int mp_dvdnav_aid_from_lang(stream_t *stream, unsigned char *language); +int mp_dvdnav_lang_from_aid(stream_t *stream, int id, unsigned char *buf); +int mp_dvdnav_sid_from_lang(stream_t *stream, unsigned char *language); +int mp_dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf); void mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button); void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button); void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl); -- cgit v1.2.3 From 9b52abcb8bdd211612b16f42c2aa6582746c6c34 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 13:06:27 +0000 Subject: Add routine that provides audio ID corresponding to logical number in dvdnav stream. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27021 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 32 ++++++++++++++++++++++++++++++++ stream/stream_dvdnav.h | 1 + 2 files changed, 33 insertions(+) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 080913baca..6e3ecb8902 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -681,6 +681,38 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but priv->mousey = y; } +/** + * \brief mp_dvdnav_aid_from_audio_num() returns the audio id corresponding to the logical number + * \param stream: - stream pointer + * \param audio_num: - logical number + * \return -1 on error, current subtitle id if successful + */ +int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num) { + dvdnav_priv_t * priv = stream->priv; + int k; + uint8_t format, lg; + + for(k=0; k<32; k++) { + lg = dvdnav_get_audio_logical_stream(priv->dvdnav, k); + if (lg == 0xff) continue; + if (lg != audio_num) continue; + format = dvdnav_audio_stream_format(priv->dvdnav, lg); + switch(format) { + case DVDNAV_FORMAT_AC3: + return k+128; + case DVDNAV_FORMAT_DTS: + return k+136; + case DVDNAV_FORMAT_LPCM: + return k+160; + case DVDNAV_FORMAT_MPEGAUDIO: + return k; + default: + return -1; + } + } + return -1; +} + /** * \brief mp_dvdnav_aid_from_lang() returns the audio id corresponding to the language code 'lang' * \param stream: - stream pointer diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index 6c155c7563..a7e3c90bd6 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -17,6 +17,7 @@ typedef struct { } nav_highlight_t; int mp_dvdnav_number_of_subs(stream_t *stream); +int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num); int mp_dvdnav_aid_from_lang(stream_t *stream, unsigned char *language); int mp_dvdnav_lang_from_aid(stream_t *stream, int id, unsigned char *buf); int mp_dvdnav_sid_from_lang(stream_t *stream, unsigned char *language); -- cgit v1.2.3 From 883dfcb4092ece166f41db6c1efd5c3d9c104c0d Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 7 Jun 2008 13:13:15 +0000 Subject: Factorizes dvdnav aid retrieval code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27022 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 57 ++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 6e3ecb8902..9030761a96 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -681,6 +681,27 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but priv->mousey = y; } +static int mp_dvdnav_get_aid_from_format (stream_t *stream, int index, uint8_t lg) { + dvdnav_priv_t * priv = stream->priv; + uint8_t format; + + format = dvdnav_audio_stream_format(priv->dvdnav, lg); + switch(format) { + case DVDNAV_FORMAT_AC3: + return (index + 128); + case DVDNAV_FORMAT_DTS: + return (index + 136); + case DVDNAV_FORMAT_LPCM: + return (index + 160); + case DVDNAV_FORMAT_MPEGAUDIO: + return index; + default: + return -1; + } + + return -1; +} + /** * \brief mp_dvdnav_aid_from_audio_num() returns the audio id corresponding to the logical number * \param stream: - stream pointer @@ -690,25 +711,14 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num) { dvdnav_priv_t * priv = stream->priv; int k; - uint8_t format, lg; + uint8_t lg; for(k=0; k<32; k++) { lg = dvdnav_get_audio_logical_stream(priv->dvdnav, k); if (lg == 0xff) continue; if (lg != audio_num) continue; - format = dvdnav_audio_stream_format(priv->dvdnav, lg); - switch(format) { - case DVDNAV_FORMAT_AC3: - return k+128; - case DVDNAV_FORMAT_DTS: - return k+136; - case DVDNAV_FORMAT_LPCM: - return k+160; - case DVDNAV_FORMAT_MPEGAUDIO: - return k; - default: - return -1; - } + + return mp_dvdnav_get_aid_from_format (stream, k, lg); } return -1; } @@ -722,7 +732,7 @@ int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num) { int mp_dvdnav_aid_from_lang(stream_t *stream, unsigned char *language) { dvdnav_priv_t * priv = stream->priv; int k; - uint8_t format, lg; + uint8_t lg; uint16_t lang, lcode;; while(language && strlen(language)>=2) { @@ -731,21 +741,8 @@ int mp_dvdnav_aid_from_lang(stream_t *stream, unsigned char *language) { lg = dvdnav_get_audio_logical_stream(priv->dvdnav, k); if(lg == 0xff) continue; lang = dvdnav_audio_stream_to_lang(priv->dvdnav, lg); - if(lang != 0xFFFF && lang == lcode) { - format = dvdnav_audio_stream_format(priv->dvdnav, lg); - switch(format) { - case DVDNAV_FORMAT_AC3: - return k+128; - case DVDNAV_FORMAT_DTS: - return k+136; - case DVDNAV_FORMAT_LPCM: - return k+160; - case DVDNAV_FORMAT_MPEGAUDIO: - return k; - default: - return -1; - } - } + if(lang != 0xFFFF && lang == lcode) + return mp_dvdnav_get_aid_from_format (stream, k, lg); } language += 2; while(language[0]==',' || language[0]==' ') ++language; -- cgit v1.2.3