mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
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
This commit is contained in:
parent
4f99e19300
commit
a5d9a2b2b0
@ -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
|
||||
*/
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user