mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
asfpacket: Avoid using broken duration extension
Quite a few (broken?) files have a packet duration of 1ms, which is most definitely wrong for either audio or video packets. We therefore avoid using that value and instead use other metrics to determine the buffer duration (like using the extended stream properties average frame duration if present and valid).
This commit is contained in:
parent
10ec322c64
commit
67f754a9ea
1 changed files with 4 additions and 2 deletions
|
@ -226,8 +226,10 @@ asf_payload_parse_replicated_data_extensions (AsfStream * stream,
|
|||
switch (ext->id) {
|
||||
case ASF_PAYLOAD_EXTENSION_DURATION:
|
||||
if (G_LIKELY (ext->len == 2)) {
|
||||
payload->duration =
|
||||
GST_READ_UINT16_LE (payload->rep_data + off) * GST_MSECOND;
|
||||
guint16 tdur = GST_READ_UINT16_LE (payload->rep_data + off);
|
||||
/* packet durations of 1ms are mostly invalid */
|
||||
if (tdur != 1)
|
||||
payload->duration = tdur * GST_MSECOND;
|
||||
} else {
|
||||
GST_WARNING ("unexpected DURATION extensions len %u", ext->len);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue