Skip to content

Feature/update ffmpeg - #13

Open
SergeGris wants to merge 14 commits into
devfrom
feature/update-ffmpeg
Open

Feature/update ffmpeg#13
SergeGris wants to merge 14 commits into
devfrom
feature/update-ffmpeg

Conversation

@SergeGris

Copy link
Copy Markdown
Collaborator

No description provided.

SergeGris and others added 13 commits May 6, 2026 02:17
The updated repeat_stream method now:
1. Uses avio_seek() to seek the I/O layer to byte 0 (start of file)
2. Flushes I/O and format buffers with avio_flush() and avformat_flush()
3. Uses av_seek_frame() to reset the demuxer
4. Flushes decoder state with avcodec_flush_buffers()
5. Includes comprehensive comments and improved error handling

This approach is more robust than pure high-level seeking and matches the
FFmpeg recommended practice for stream repetition in modern versions.
Removed low-level avio_seek operations that cause segfaults. The new approach:
1. Only uses av_seek_frame with proper flags (AVSEEK_FLAG_BACKWARD)
2. Flushes decoder buffers after seeking
3. Avoids mixing low-level I/O with format context operations

This is more reliable and safer across different file formats and FFmpeg versions.
@hack3rmann
hack3rmann self-requested a review May 7, 2026 06:08
@hack3rmann

Copy link
Copy Markdown
Owner

repeat_stream is suboptimal and doesn't do the same thing as before

@hack3rmann hack3rmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeat_stream must do the same thing as before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants