[vlc-commits] [Git][videolan/vlc][master] demux: mp4: fix RAP fallback
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Mon Sep 7 07:42:22 UTC 2026
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
691c9c51 by François Cartegnie at 2026-09-07T09:24:09+02:00
demux: mp4: fix RAP fallback
no stss -> fail
empty stss -> look further
Also fixes sample 0 returns.
And regression from 07a2ad663da8631e904f22b0deee29de96a38bca
- - - - -
1 changed file:
- modules/demux/mp4/mp4.c
Changes:
=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -3456,19 +3456,25 @@ static int TrackGetNearestSeekPoint( demux_t *p_demux, mp4_track_t *p_track,
}
}
}
+ else // no stss, any sample is sync point
+ {
+ return VLC_EGENERIC;
+ }
- if (*pi_sync_sample != i_sample)
+ if( i_ret == VLC_SUCCESS && *pi_sync_sample == i_sample )
+ return VLC_SUCCESS; // nothing to do
+
+ /* Empty but present stss, try or refine using RAP with recovery roll info */
+ uint32_t i_alternative_sync_sample = i_sample;
+ if( MP4_SampleToGroupInfo( p_track->p_stbl, i_sample, SAMPLEGROUP_rap,
+ 0, &i_alternative_sync_sample, true, NULL ) )
{
- /* try or refine using RAP with recovery roll info */
- uint32_t i_alternative_sync_sample = i_sample;
- if( MP4_SampleToGroupInfo( p_track->p_stbl, i_sample, SAMPLEGROUP_rap,
- 0, &i_alternative_sync_sample, true, NULL ) )
+ msg_Dbg( p_demux, "tk %u sbgp gives %d --> %" PRIu32 " (sample number)",
+ p_track->i_track_ID, i_sample, i_alternative_sync_sample );
+ if( i_alternative_sync_sample > *pi_sync_sample || i_ret != VLC_SUCCESS )
{
- msg_Dbg( p_demux, "tk %u sbgp gives %d --> %" PRIu32 " (sample number)",
- p_track->i_track_ID, i_sample, i_alternative_sync_sample );
- if( i_alternative_sync_sample > *pi_sync_sample &&
- i_alternative_sync_sample < i_sample )
- *pi_sync_sample = i_alternative_sync_sample;
+ *pi_sync_sample = i_alternative_sync_sample;
+ return VLC_SUCCESS;
}
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/691c9c51b1ef18f71e377e194d09151d0c98af65
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/691c9c51b1ef18f71e377e194d09151d0c98af65
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list