mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
ext/dvdread/dvdreadsrc.c: Make check stronger.
Original commit message from CVS: * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_is_nav_pack): Make check stronger.
This commit is contained in:
parent
3142e1a289
commit
b756660a3c
2 changed files with 29 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-06-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_is_nav_pack):
|
||||||
|
Make check stronger.
|
||||||
|
|
||||||
2006-06-28 Tim-Philipp Müller <tim at centricular dot net>
|
2006-06-28 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad),
|
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad),
|
||||||
|
|
|
@ -510,13 +510,32 @@ gst_dvd_read_src_get_next_cell_for (GstDvdReadSrc * src, gint cell)
|
||||||
return cell + 1; /* really +1? (tpm) */
|
return cell + 1; /* really +1? (tpm) */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if the pack is a NAV pack. This check is clearly insufficient,
|
/* Returns true if the pack is a NAV pack */
|
||||||
* and sometimes we incorrectly think that valid other packs are NAV packs. I
|
|
||||||
* need to make this stronger. */
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvd_read_src_is_nav_pack (const guint8 * buffer)
|
gst_dvd_read_src_is_nav_pack (const guint8 * data)
|
||||||
{
|
{
|
||||||
return (buffer[41] == 0xbf && buffer[1027] == 0xbf);
|
if (GST_READ_UINT32_BE (data + 0x26) != 0x000001BF)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Check that this is substream 0 (PCI) */
|
||||||
|
if (data[0x2c] != 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (GST_READ_UINT32_BE (data + 0x400) != 0x000001BF)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Check that this is substream 1 (DSI) */
|
||||||
|
if (data[0x406] != 1)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Check sizes of PCI and DSI packets */
|
||||||
|
if (GST_READ_UINT16_BE (data + 0x2a) != 0x03d4)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (GST_READ_UINT16_BE (data + 0x404) != 0x03fa)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
Loading…
Reference in a new issue