diff options
author | eddyg <[email protected]> | 2007-08-27 02:59:09 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2007-08-27 02:59:09 +0000 |
commit | 62f2a3809bd4eb9cbacdacc7aa969976a61eeccd (patch) | |
tree | 9056b2b26fc90aaa2847cd693517d1f9f41cafc0 | |
parent | 74d6813ce3d07ced59a1426d52a0f87583768e24 (diff) |
Improved error handling when disk already full for MKV containers.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@871 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/muxmkv.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c index cb69efa91..b7c7d2dc6 100644 --- a/libhb/muxmkv.c +++ b/libhb/muxmkv.c @@ -53,6 +53,14 @@ static int MKVInit( hb_mux_object_t * m ) m->file = mk_createWriter(job->file, 1000000, 1); + if( !m->file ) + { + hb_error( "Could not create output file, Disk Full?" ); + job->mux_data = NULL; + *job->die = 1; + return 0; + } + /* Video track */ mux_data = calloc(1, sizeof( hb_mux_data_t ) ); job->mux_data = mux_data; @@ -268,7 +276,7 @@ static int MKVMux( hb_mux_object_t * m, hb_mux_data_t * mux_data, if( mk_startFrame(m->file, mux_data->track) < 0) { - hb_error( "Failed to write start frame to output file, Disk Full?" ); + hb_error( "Failed to write frame to output file, Disk Full?" ); *job->die = 1; } mk_addFrameData(m->file, mux_data->track, buf->data, buf->size); @@ -282,10 +290,20 @@ static int MKVEnd( hb_mux_object_t * m ) hb_job_t *job = m->job; hb_mux_data_t *mux_data = job->mux_data; hb_title_t *title = job->title; - hb_chapter_t *chapter_data = hb_list_item( title->list_chapter, mux_data->current_chapter++ ); + hb_chapter_t *chapter_data; char tmp_buffer[1024]; char *string = tmp_buffer; + if( !job->mux_data ) + { + /* + * We must have failed to create the file in the first place. + */ + return 0; + } + + chapter_data = hb_list_item( title->list_chapter, mux_data->current_chapter++ ); + if(job->chapter_markers) { tmp_buffer[0] = '\0'; |