[FFmpeg-trac] #8772(avformat:reopened): MXF-muxing fails with Error writing trailer of test.mxf Unknown error occurred
FFmpeg
trac at avcodec.org
Sat Jul 4 18:57:58 EEST 2020
#8772: MXF-muxing fails with Error writing trailer of test.mxf Unknown error
occurred
------------------------------------+------------------------------------
Reporter: steipal | Owner:
Type: defect | Status: reopened
Priority: minor | Component: avformat
Version: git-master | Resolution:
Keywords: mxf | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Comment (by Tjoppen):
How about something like this?
{{{
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 5a3a609bf6..7a3c505918 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2955,9 +2955,13 @@ static int mxf_write_footer(AVFormatContext *s)
AVIOContext *pb = s->pb;
int i, err;
- if (!mxf->header_written ||
- (s->oformat == &ff_mxf_opatom_muxer &&
!mxf->body_partition_offset)) {
- /* reason could be invalid options/not supported codec/out of
memory */
+ /* reason could be invalid options/not supported codec/out of memory
*/
+ if (!mxf->header_written) {
+ av_log(s, AV_LOG_ERROR, "No header written yet, can't write
footer. Severe A/V desync?\n");
+ return AVERROR_UNKNOWN;
+ }
+ if (s->oformat == &ff_mxf_opatom_muxer &&
!mxf->body_partition_offset) {
+ av_log(s, AV_LOG_ERROR, "No body partition written yet, can't
write footer. Severe A/V desync?\n");
return AVERROR_UNKNOWN;
}
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8772#comment:10>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list