mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
oggdemux: Fix granulepos->key granule calculation for Dirac
This commit is contained in:
parent
d6b6d0cdad
commit
ac2d0170a8
1 changed files with 24 additions and 1 deletions
|
@ -465,6 +465,29 @@ granule_to_granulepos_dirac (GstOggStream * pad, gint64 granule,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gint64
|
||||||
|
granulepos_to_key_granule_dirac (GstOggStream * pad, gint64 gp)
|
||||||
|
{
|
||||||
|
gint64 pt;
|
||||||
|
int dist_h;
|
||||||
|
int dist_l;
|
||||||
|
int dist;
|
||||||
|
int delay;
|
||||||
|
gint64 dt;
|
||||||
|
|
||||||
|
if (gp == -1 || gp == 0)
|
||||||
|
return gp;
|
||||||
|
|
||||||
|
pt = ((gp >> 22) + (gp & OGG_DIRAC_GRANULE_LOW_MASK)) >> 9;
|
||||||
|
dist_h = (gp >> 22) & 0xff;
|
||||||
|
dist_l = gp & 0xff;
|
||||||
|
dist = (dist_h << 8) | dist_l;
|
||||||
|
delay = (gp >> 9) & 0x1fff;
|
||||||
|
dt = pt - delay;
|
||||||
|
|
||||||
|
return dt - 2 * dist + 4;
|
||||||
|
}
|
||||||
|
|
||||||
/* VP8 */
|
/* VP8 */
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -1600,7 +1623,7 @@ static const GstOggMap mappers[] = {
|
||||||
is_keyframe_dirac,
|
is_keyframe_dirac,
|
||||||
is_header_count,
|
is_header_count,
|
||||||
packet_duration_constant,
|
packet_duration_constant,
|
||||||
NULL
|
granulepos_to_key_granule_dirac
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"VP80\1", 5, 4,
|
"VP80\1", 5, 4,
|
||||||
|
|
Loading…
Reference in a new issue