summaryrefslogtreecommitdiffstats
path: root/libhb/muxmkv.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2007-08-27 01:55:10 +0000
committereddyg <[email protected]>2007-08-27 01:55:10 +0000
commit03d32783ea021b5ae8e744f094af90197294327a (patch)
treecf243fdee3f2d02359608be5b3816d6c38919105 /libhb/muxmkv.c
parentd5e4f2a6c2d7a32529866692ec70720fd787808a (diff)
Added rudimentory error handling to HB. Instead of using hb_log() use hb_error(). Also causes us to stop muxing when we get a write error in MP4 and MKV containers. Still requires macosx dialog box by dynaflash (see main.mm for stub to use).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@869 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmkv.c')
-rw-r--r--libhb/muxmkv.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c
index 0a78ac69f..62a4dd929 100644
--- a/libhb/muxmkv.c
+++ b/libhb/muxmkv.c
@@ -100,7 +100,7 @@ static int MKVInit( hb_mux_object_t * m )
break;
default:
*job->die = 1;
- hb_log("muxmkv: Unknown video codec: %x", job->vcodec);
+ hb_error("muxmkv: Unknown video codec: %x", job->vcodec);
return 0;
}
@@ -171,7 +171,7 @@ static int MKVInit( hb_mux_object_t * m )
break;
default:
*job->die = 1;
- hb_log("muxmkv: Unknown audio codec: %x", job->acodec);
+ hb_error("muxmkv: Unknown audio codec: %x", job->acodec);
return 0;
}
@@ -191,7 +191,11 @@ static int MKVInit( hb_mux_object_t * m )
free(track->codecPrivate);
}
- mk_writeHeader( m->file, "HandBrake " HB_VERSION);
+ if( mk_writeHeader( m->file, "HandBrake " HB_VERSION) < 0 )
+ {
+ hb_error( "Failed to write to output file, disk full?");
+ *job->die = 1;
+ }
if (track != NULL)
free(track);
if (avcC != NULL)
@@ -262,10 +266,22 @@ static int MKVMux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
}
}
- mk_startFrame(m->file, mux_data->track);
- mk_addFrameData(m->file, mux_data->track, buf->data, buf->size);
- mk_setFrameFlags(m->file, mux_data->track, timecode,
- ((job->vcodec == HB_VCODEC_X264 && mux_data == job->mux_data) ? (buf->frametype == HB_FRAME_IDR) : ((buf->frametype & HB_FRAME_KEY) != 0)) );
+ if( mk_startFrame(m->file, mux_data->track) < 0)
+ {
+ hb_error( "Failed to write start frame to output file, Disk Full?" );
+ *job->die = 1;
+ }
+ if( mk_addFrameData(m->file, mux_data->track, buf->data, buf->size) < 0 )
+ {
+ hb_error( "Failed to write frame data to output file, Disk Full?" );
+ *job->die = 1;
+ }
+ if( mk_setFrameFlags(m->file, mux_data->track, timecode,
+ ((job->vcodec == HB_VCODEC_X264 && mux_data == job->mux_data) ? (buf->frametype == HB_FRAME_IDR) : ((buf->frametype & HB_FRAME_KEY) != 0)) ) < 0 )
+ {
+ hb_error( "Failed to write frame flags to output file, Disk Full?" );
+ *job->die = 1;
+ }
return 0;
}