From 29ff2e254871ebc359af344d6ee453047e8ad2ec Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 27 Mar 2005 10:18:02 +0000 Subject: Reimplemented the error object as a stack. --- src/decoder.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/decoder.cc') diff --git a/src/decoder.cc b/src/decoder.cc index eae0f76..dfddd87 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -51,7 +51,7 @@ Decoder::Decoder(Error* err, memset(&dvpars, 0, sizeof(dvpars)); if(!(iformat = av_find_input_format("dv1394"))) { - errobj->setError("Failed to get input format dv1394"); + errobj->pushError("Failed to get input format dv1394."); exit(1); } @@ -60,23 +60,23 @@ Decoder::Decoder(Error* err, dvpars.standard = "pal"; if(av_open_input_file(&ifc, "", iformat, 0, &dvpars) < 0) { - errobj->setError("Device is in use."); + errobj->pushError("Device is in use."); fc = NULL; return; } if(av_find_stream_info(ifc) < 0) { - errobj->setError("Could not find enough parameters."); + errobj->pushError("Could not find enough parameters."); fc = NULL; return; } dump_format(ifc, 1, "", 0); if(!(dec_codec = avcodec_find_decoder(ifc->streams[0]->codec.codec_id))) { - errobj->setError("Unsupported codec for input stream "); + errobj->pushError("Unsupported codec for input stream."); fc = NULL; return; } if(avcodec_open(&ifc->streams[0]->codec, dec_codec) < 0) { - errobj->setError("Error while opening codec for input stream"); + errobj->pushError("Error while opening codec for input stream."); fc = NULL; return; } @@ -92,7 +92,7 @@ Decoder::~Decoder() void Decoder::decode() { if(fc == NULL) { - errobj->setError("Decoder not initialized."); + errobj->pushError("Decoder not initialized."); return; } @@ -125,7 +125,7 @@ void Decoder::decode() fff->frame, &got_picture, ptr, len); if(ret < 0) { - errobj->setError("Error while decoding stream"); + errobj->pushError("Error while decoding stream."); exit(1); } -- cgit v1.2.3