]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
if format header is not written (== no data written) dont crash, instead log a messag...
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 19 Sep 2007 13:35:46 +0000 (13:35 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 19 Sep 2007 13:35:46 +0000 (13:35 +0000)
pvr_rec.c

index 1aa6f25764f2a3d09b0dfceab7edbec41e090240..46a4841766e8a154de5f7033a346229a6f3fd737 100644 (file)
--- a/pvr_rec.c
+++ b/pvr_rec.c
@@ -830,7 +830,8 @@ pwo_end(pvr_rec_t *pvrr)
   AVStream *st;
   int i;
 
-  av_write_trailer(pf->fctx);
+  if(pf->header_written)
+    av_write_trailer(pf->fctx);
 
   for(i = 0; i < pf->fctx->nb_streams; i++) {
     st = pf->fctx->streams[i];
@@ -842,6 +843,12 @@ pwo_end(pvr_rec_t *pvrr)
   url_fclose(&pf->fctx->pb);
   free(pf->fctx);
 
+  if(!pf->header_written) {
+    syslog(LOG_DEBUG, "pvr: \"%s\" - No content recorded, removing file",
+          pvrr->pvrr_printname);
+    unlink(pvrr->pvrr_filename);
+  }
+
   free(pf);
   return 0;
 }