diff options
| author | dec05eba <dec05eba@protonmail.com> | 2026-08-05 14:56:59 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-08-05 14:56:59 +0200 |
| commit | e6c1cf0ec1ce220912a6ef6b6fac5ba9b2e98276 (patch) | |
| tree | 5e5636b9bc485a0efc37af6b03fccc99401d671b /include | |
| parent | fbc31a9561d16418226c0efa65e2a73923516dbd (diff) | |
workaround ffmpeg hybrid_fragmented bug when no packets have been recorded yet
Diffstat (limited to 'include')
| -rw-r--r-- | include/ffmpeg_utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/ffmpeg_utils.h b/include/ffmpeg_utils.h index 35524c2..6d7481b 100644 --- a/include/ffmpeg_utils.h +++ b/include/ffmpeg_utils.h @@ -1,6 +1,19 @@ #ifndef GSR_FFMPEG_UTILS_H #define GSR_FFMPEG_UTILS_H +#include <stdbool.h> + +typedef struct AVFormatContext AVFormatContext; + const char* gsr_av_error_to_string(int err); +/* Marks that a packet has been successfully written to |av_format_context|, see gsr_av_format_context_write_trailer */ +void gsr_av_format_context_mark_packet_written(AVFormatContext *av_format_context); +/* + The same as av_write_trailer, except that the trailer is not written when no packet has been written to a muxer + that uses the hybrid_fragmented movflags option (see set_format_context_options), because the mov muxer in FFmpeg + crashes when it finalizes a hybrid_fragmented file that has no packets. Returns 0 on success, just like av_write_trailer. +*/ +int gsr_av_format_context_write_trailer(AVFormatContext *av_format_context); + #endif /* GSR_FFMPEG_UTILS_H */ |
