[FFmpeg-devel] [PATCH] avformat/fifo: Check for keyframe video type before stop dropping

Arthur Grillo arthurgrillo at riseup.net
Sat Apr 5 20:37:28 EEST 2025



On 29/03/25 7:57 PM, Michael Niedermayer wrote:
> Hi Arthur
> 
> On Wed, Mar 12, 2025 at 03:45:42PM -0300, Arthur Grillo wrote:
>> The current behavior when using restart_with_keyframe is that it will
>> recover if it also encounters any audio packet, as they are flagged as a
>> keyframe.
>>
>> The expectation is that packets are dropped until the next _video_
>> keyframe.
>>
>> Fix that by checking the packet stream codec type, only letting it
>> recover when it is a video one.
>>
>> Fixes ticket: #11467
>>
>> Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
>> ---
>> Cc: lingjiujianke at gmail.com
>> ---
>>  libavformat/fifo.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> What happens if there is no video stream ?
> 
> thx

Well noted, I will add a check for the existence of a video stream, if
no video stream is found, it will resume to the original behavior of not
caring about the stream type.

Regards,
~Grillo


> 
> [...]
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list