From: Andreas Ă–man Date: Wed, 19 Sep 2007 13:35:46 +0000 (+0000) Subject: if format header is not written (== no data written) dont crash, instead log a messag... X-Git-Tag: 2.12~1431 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aeaadebfa03d480421b7df5401a8550af6237014;p=thirdparty%2Ftvheadend.git if format header is not written (== no data written) dont crash, instead log a message and remove the file --- diff --git a/pvr_rec.c b/pvr_rec.c index 1aa6f2576..46a484176 100644 --- 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; }