Ticket #237: mpeg2trans.patch
File mpeg2trans.patch, 3.0 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/jobqueue.cpp
1602 1602 // Get new filesize 1603 1603 struct stat st; 1604 1604 long long filesize = 0; 1605 long long orig_filesize = 0; 1606 if (stat(filename.ascii(), &st) == 0) 1607 orig_filesize = st.st_size; 1605 1608 if (stat(tmpfile.ascii(), &st) == 0) 1606 filesize = st.st_size;1609 filesize = st.st_size; 1607 1610 // To save the original file... 1608 1611 QString oldfile = filename; 1609 1612 oldfile += ".old"; … … 1616 1619 MSqlQuery query(MSqlQuery::InitCon()); 1617 1620 QString querystr; 1618 1621 querystr = QString("DELETE FROM recordedmarkup WHERE " 1619 "chanid = '%1' AND starttime = '%2';") 1620 .arg(program_info->chanid).arg(startts); 1622 "chanid = '%1' AND starttime = '%2'" 1623 "AND type != '%3';") 1624 .arg(program_info->chanid).arg(startts) 1625 .arg(MARK_GOP_BYFRAME); 1621 1626 query.prepare(querystr); 1622 1627 query.exec(); 1623 1628 … … 1643 1648 } 1644 1649 if (filesize > 0) 1645 1650 program_info->SetFilesize(filesize); 1646 ChangeJobStatus(jobID, JOB_FINISHED); 1651 1652 msg = QString("Finished. File size: %1 MB (saved %2 MB).") 1653 .arg(filesize/(1024*1024)) 1654 .arg((orig_filesize - filesize)/(1024*1024)); 1655 ChangeJobStatus(jobID, JOB_FINISHED, msg); 1647 1656 } else { 1648 1657 // transcode didn't finish delete partial transcode 1649 1658 filename += ".tmp"; -
programs/mythtranscode/mpeg2trans.cpp
299 299 if (posMap.empty()) 300 300 { 301 301 // no MARK_GOP_BYFRAME entries in the recordedmarkup table 302 // trying MARK_GOP_START 303 m_pginfo->GetPositionMap(posMap, MARK_GOP_START); 304 if (posMap.empty()) 305 { 306 VERBOSE(VB_IMPORTANT, QString("No position map found, this is bad")); 307 } 302 // recordings from some setups have MARK_GOP_START entries 303 // in the recordedmarkup table. These are sequentially 304 // numbered, not frame numbers. We can't use them here. 305 // Regenerate the position map with MARK_GOP_BYFRAME 306 307 VERBOSE(VB_IMPORTANT, QString("Rebulding position map.")); 308 if (BuildKeyframeIndex(infile, posMap) == TRANSCODE_EXIT_OK) 309 m_pginfo->SetPositionMap(posMap, MARK_GOP_BYFRAME); 310 else 311 VERBOSE(VB_IMPORTANT, QString("No position map and cound't rebuild it, this is bad")); 308 312 } 309 313 310 314 if (useCutlist)