mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
avidemux: additional verification heuristics for VBR audio stream
Check for and override some header field(s) for reasonable values, according to later expected use in calculations.
This commit is contained in:
parent
d5a4da9a69
commit
7955c01f19
1 changed files with 13 additions and 0 deletions
|
@ -2005,6 +2005,19 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf)
|
||||||
"invalid audio header, ignoring stream");
|
"invalid audio header, ignoring stream");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
/* some more sanity checks */
|
||||||
|
if (stream->is_vbr) {
|
||||||
|
if (stream->strf.auds->blockalign <= 4) {
|
||||||
|
/* that would mean (too) many frames per chunk,
|
||||||
|
* so not likely set as expected */
|
||||||
|
GST_DEBUG_OBJECT (element,
|
||||||
|
"suspicious blockalign %d for VBR audio; "
|
||||||
|
"overriding to 1 frame per chunk",
|
||||||
|
stream->strf.auds->blockalign);
|
||||||
|
/* this should top any likely value */
|
||||||
|
stream->strf.auds->blockalign = (1 << 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GST_RIFF_FCC_iavs:
|
case GST_RIFF_FCC_iavs:
|
||||||
stream->is_vbr = TRUE;
|
stream->is_vbr = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue