[mythtv] [PATCH] don't die if recorded file is garbled
Steve Bower
sbower at cisco.com
Mon Sep 22 18:59:05 EDT 2003
Me> Let me know if you like it or not, it's my first contribution! :-)
Isaac> I don't want to apply this, as there's nothing to catch the error.
Hi Isaac,
Thanks for the feedback.
However, I'm puzzled... The patch I sent changes
AvFormatDecoder::OpenFile to return -1 in case of an error, instead of
exiting the process.
AFAICT, the only thing that calls this routine is
NuppelVideoPlayer::OpenFile, which checks to see if the return value is
<0, and if so flags the error.
The same code invokes NuppelDecoder::OpenFile, which already returns -1
in case of error.
So is there something else you want done as part of this patch, that
involves the other codec classes? Or am I missing some other place that
invokes this method? If you give me a better hint as to what you're
looking for, I might be able to figure something out...
Thanks,
Steve.
P.S. patch included again for easy reference. :-)
Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/avformatdecoder.cpp,v
retrieving revision 1.53
diff -u -r1.53 avformatdecoder.cpp
--- libs/libmythtv/avformatdecoder.cpp 11 Sep 2003 15:38:11 -0000 1.53
+++ libs/libmythtv/avformatdecoder.cpp 21 Sep 2003 14:42:16 -0000
@@ -256,15 +256,15 @@
int err = av_open_input_file(&ic, filename, fmt, 0, ¶ms);
if (err < 0)
{
- cerr << "avformat error: " << err << endl;
- exit(0);
+ cerr << "avformat error opening " << filename << ": " << err << endl;
+ return -1;
}
int ret = av_find_stream_info(ic);
if (ret < 0)
{
cerr << "could not find codec parameters: " << filename << endl;
- exit(0);
+ return -1;
}
fmt->flags &= ~AVFMT_NOFILE;
More information about the mythtv-dev
mailing list