mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
Ignore packets with missing dts in peek_first_pts (#40299)
This commit is contained in:
parent
3efda8d1d2
commit
f1ee7fed4c
@ -113,7 +113,11 @@ def _stream_worker_internal(hass, stream, quit_event):
|
|||||||
# Get to first video keyframe
|
# Get to first video keyframe
|
||||||
while first_packet[video_stream] is None:
|
while first_packet[video_stream] is None:
|
||||||
packet = next(container.demux())
|
packet = next(container.demux())
|
||||||
if packet.stream == video_stream and packet.is_keyframe:
|
if (
|
||||||
|
packet.stream == video_stream
|
||||||
|
and packet.is_keyframe
|
||||||
|
and packet.dts is not None
|
||||||
|
):
|
||||||
first_packet[video_stream] = packet
|
first_packet[video_stream] = packet
|
||||||
initial_packets.append(packet)
|
initial_packets.append(packet)
|
||||||
# Get first_pts from subsequent frame to first keyframe
|
# Get first_pts from subsequent frame to first keyframe
|
||||||
@ -121,6 +125,8 @@ def _stream_worker_internal(hass, stream, quit_event):
|
|||||||
[pts is None for pts in {**first_packet, **first_pts}.values()]
|
[pts is None for pts in {**first_packet, **first_pts}.values()]
|
||||||
) and (len(initial_packets) < PACKETS_TO_WAIT_FOR_AUDIO):
|
) and (len(initial_packets) < PACKETS_TO_WAIT_FOR_AUDIO):
|
||||||
packet = next(container.demux((video_stream, audio_stream)))
|
packet = next(container.demux((video_stream, audio_stream)))
|
||||||
|
if packet.dts is None:
|
||||||
|
continue # Discard packets with no dts
|
||||||
if (
|
if (
|
||||||
first_packet[packet.stream] is None
|
first_packet[packet.stream] is None
|
||||||
): # actually video already found above so only for audio
|
): # actually video already found above so only for audio
|
||||||
|
Loading…
x
Reference in New Issue
Block a user