summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-10-21 21:00:22 +0000
committerjstebbins <[email protected]>2013-10-21 21:00:22 +0000
commit5c2f3ad805987c7404cc676532f025f0d2516930 (patch)
tree8940fef379290d0df1fb0923abb9d9688d74d59c /libhb
parent310454f3726b2187a59246420611a284d7c28c84 (diff)
libhb: check AVIOContext.error for errors while muxing
libavformat doesn't always check this, so the return code from av_interleaved_write_frame doesn't indicate an error when there is a failure to write to disk. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5850 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/muxavformat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
index 31b9aa46a..1121a352a 100644
--- a/libhb/muxavformat.c
+++ b/libhb/muxavformat.c
@@ -1138,7 +1138,10 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
pkt.stream_index = track->st->index;
int ret = av_interleaved_write_frame(m->oc, &pkt);
- if (ret < 0)
+ // Many avformat muxer functions do not check the error status
+ // of the AVIOContext. So we need to check it ourselves to detect
+ // write errors (like disk full condition).
+ if (ret < 0 || m->oc->pb->error != 0)
{
hb_error("av_interleaved_write_frame failed!");
*job->die = 1;