Mercurial > mplayer.hg
changeset 26984:540400f89398
Add routine to determine if SPU has changed in dvdnav stream.
author | ben |
---|---|
date | Sat, 07 Jun 2008 12:42:00 +0000 |
parents | a9626d7ae755 |
children | 9ab366f856c1 |
files | stream/stream_dvdnav.c stream/stream_dvdnav.h |
diffstat | 2 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/stream/stream_dvdnav.c Sat Jun 07 12:37:32 2008 +0000 +++ b/stream/stream_dvdnav.c Sat Jun 07 12:42:00 2008 +0000 @@ -32,6 +32,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 */
--- a/stream/stream_dvdnav.h Sat Jun 07 12:37:32 2008 +0000 +++ b/stream/stream_dvdnav.h Sat Jun 07 12:42:00 2008 +0000 @@ -32,6 +32,7 @@ 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 */