[FFmpeg-devel] [PATCH v3] mov: Compare frag times in correct time base when seeking a stream without a corresponding sidx

Derek Buitenhuis derek.buitenhuis at gmail.com
Tue Aug 16 19:32:04 EEST 2022


On 8/16/2022 5:21 PM, Zhao Zhili wrote:
> get_frag_time() can be called with an mp4 file which has no sidx at all. In that case,
> dst_st should have a higher priority than other streams, even if sc->has_sidx is false.
> And first_tfra_pts might be used here, which makes the check of sc->has_sidx unnatural.
> So in my opinion, the check on sc->has_sidx should be removed.

This seems like it should be in a separate patch, though - it is changing a different
behavior than what this patch does.

> +    frag_stream_info = get_frag_stream_info(frag_index, index, dst_st->id);
> +    timestamp = get_stream_info_time(frag_stream_info);
> +    if (timestamp != AV_NOPTS_VALUE)
> +        return timestamp;

I did look at that, but I do not think it can be.

get_stream_info_time is not equivalent to what is here. get_stream_info_time will
eventually fall back to frag_stream_info->tfdt_dts, where as this code falls back
to frag_stream_info->sidx_pts even if it is AV_NOPTS_VALUE. It would be a behavior
change do use get_stream_info_time here.

- Derek


More information about the ffmpeg-devel mailing list