[mythtv] [PATCH] don't die if recorded file is garbled

Steve Bower sbower at cisco.com
Sun Sep 21 11:44:48 EDT 2003


Howdy,

Just reiterating a little patch I sent last week -- if myth can't figure
out what type of data is in a file (happens at least with pchdtv cards
that have the wrong frequency for a station), it (the backend or
frontend, depending on who detects it) currently dies, which is quite
unfriendly...  :-)

This patch makes it continue with an error.  Regenerated it with diff -u
instead of -c.

Let me know if you like it or not, it's my first contribution!  :-)

  Steve.

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, &params);
     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