mirror of
https://github.com/ossrs/srs.git
synced 2026-01-12 00:05:45 +08:00
When recording HEVC streams to MP4, DVR fails with error "doesn't support hvcC change" (ERROR_MP4_HVCC_CHANGE). The root cause is in video_avc_demux(): the SrsVideoFrame object is reused across frames, and its initialize() method does not reset avc_packet_type. When a sequence header is processed, avc_packet_type is set to 0 (SrsVideoAvcFrameTraitSequenceHeader). When the next video info frame arrives (which only appears in HEVC streams), the function returns early without assigning video->avc_packet_type, so it retains the value 0 from the previous sequence header frame. When DVR processes this video info frame, it checks avc_packet_type and incorrectly identifies it as a sequence header. Since the real HEVC sequence header was already recorded, DVR returns the "hvcC change" error. The fix assigns video->avc_packet_type = packet_type before returning early for VideoInfoFrame, ensuring DVR correctly identifies the frame type. Fix #4603 for 6.0release --------- Co-authored-by: OSSRS-AI <winlinam@gmail.com>