mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
add a new state flag to dvdnav in order to notify if
something has changed in the current stream (being title, chapter, audio layer or SPU one) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25858 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
923c1f08ca
commit
6230aab9bf
@ -30,6 +30,7 @@ typedef enum {
|
||||
NAV_FLAG_WAIT_READ = 1 << 5, /* suspend read from stream */
|
||||
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 */
|
||||
} dvdnav_state_t;
|
||||
|
||||
typedef struct {
|
||||
@ -198,6 +199,7 @@ static int dvdnav_stream_read(dvdnav_priv_t * priv, unsigned char *buf, int *len
|
||||
uint32_t nextstill;
|
||||
|
||||
priv->state &= ~NAV_FLAG_WAIT_SKIP;
|
||||
priv->state |= NAV_FLAG_STREAM_CHANGE;
|
||||
if(ev->pgc_length)
|
||||
priv->duration = ev->pgc_length/90;
|
||||
|
||||
@ -233,6 +235,11 @@ static int dvdnav_stream_read(dvdnav_priv_t * priv, unsigned char *buf, int *len
|
||||
}
|
||||
case DVDNAV_VTS_CHANGE: {
|
||||
priv->state &= ~NAV_FLAG_WAIT_SKIP;
|
||||
priv->state |= NAV_FLAG_STREAM_CHANGE;
|
||||
break;
|
||||
}
|
||||
case DVDNAV_SPU_STREAM_CHANGE: {
|
||||
priv->state |= NAV_FLAG_STREAM_CHANGE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -899,9 +906,22 @@ int mp_dvdnav_cell_has_changed (stream_t *stream, int clear) {
|
||||
return 0;
|
||||
if (clear)
|
||||
priv->state &= ~NAV_FLAG_CELL_CHANGED;
|
||||
if (clear) priv->state |= NAV_FLAG_STREAM_CHANGE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Notify if something has changed in stream
|
||||
* Can be related to title, chapter, audio or SPU
|
||||
*/
|
||||
int mp_dvdnav_stream_has_changed (stream_t *stream) {
|
||||
dvdnav_priv_t *priv = stream->priv;
|
||||
|
||||
if (!(priv->state & NAV_FLAG_STREAM_CHANGE))
|
||||
return 0;
|
||||
|
||||
priv->state &= ~NAV_FLAG_STREAM_CHANGE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
const stream_info_t stream_info_dvdnav = {
|
||||
"DVDNAV stream",
|
||||
|
@ -27,5 +27,6 @@ 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_stream_has_changed (stream_t *stream);
|
||||
|
||||
#endif /* MPLAYER_STREAM_DVDNAV_H */
|
||||
|
Loading…
Reference in New Issue
Block a user