From 35f0582ca1b573bb085cf7e45e0efd8cc4882b45 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 21 May 2015 08:59:05 +0200 Subject: [PATCH] - moviecut: don't paint progressbar when no bookmarks found --- src/driver/moviecut.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/driver/moviecut.cpp b/src/driver/moviecut.cpp index 8ede3408b..e21844ca7 100644 --- a/src/driver/moviecut.cpp +++ b/src/driver/moviecut.cpp @@ -317,14 +317,6 @@ bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) time_t tt = time(0); time_t tt1; - unsigned char * buf = new unsigned char[BUF_SIZE]; - if (buf == 0) { - perror("new"); - return false; - } - - paintProgress(true); - off64_t size = minfo->file.Size; off64_t secsize = getSecondSize(minfo); off64_t newsize = size; @@ -356,11 +348,18 @@ bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) printf("CMovieCut::%s: end bookmark %d at %" PRId64 "\n", __func__, bcount, books[bcount].pos); bcount++; } - printf("\n"); - if (!bcount) { - delete [] buf; + + if (!bcount) + return false; + + unsigned char * buf = new unsigned char[BUF_SIZE]; + if (buf == 0) { + perror("new"); return false; } + + paintProgress(true); + qsort(books, bcount, sizeof(struct mybook), compare_book); for (int i = 0; i < bcount; i++) { if (books[i].ok) { @@ -528,6 +527,7 @@ bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi bcount++; } } + if (!bcount) return false;