summaryrefslogtreecommitdiff
path: root/src/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder.cc')
-rw-r--r--src/decoder.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/decoder.cc b/src/decoder.cc
index dfddd87..bf9b75c 100644
--- a/src/decoder.cc
+++ b/src/decoder.cc
@@ -52,7 +52,8 @@ Decoder::Decoder(Error* err,
if(!(iformat = av_find_input_format("dv1394"))) {
errobj->pushError("Failed to get input format dv1394.");
- exit(1);
+ fc = NULL;
+ return;
}
dvpars.device = device; /* "/dev/dv1394"; */
@@ -61,23 +62,27 @@ Decoder::Decoder(Error* err,
if(av_open_input_file(&ifc, "", iformat, 0, &dvpars) < 0) {
errobj->pushError("Device is in use.");
- fc = NULL; return;
+ fc = NULL;
+ return;
}
if(av_find_stream_info(ifc) < 0) {
errobj->pushError("Could not find enough parameters.");
- fc = NULL; return;
+ fc = NULL;
+ return;
}
dump_format(ifc, 1, "", 0);
if(!(dec_codec = avcodec_find_decoder(ifc->streams[0]->codec.codec_id))) {
errobj->pushError("Unsupported codec for input stream.");
- fc = NULL; return;
+ fc = NULL;
+ return;
}
if(avcodec_open(&ifc->streams[0]->codec, dec_codec) < 0) {
errobj->pushError("Error while opening codec for input stream.");
- fc = NULL; return;
+ fc = NULL;
+ return;
}
fc = ifc;
@@ -126,7 +131,7 @@ void Decoder::decode()
if(ret < 0) {
errobj->pushError("Error while decoding stream.");
- exit(1);
+ return;
}
len -= ret;