Changeset 127 for smplayer/vendor/current/src/mplayerprocess.cpp
- Timestamp:
- Mar 29, 2012, 3:09:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/mplayerprocess.cpp
r121 r127 76 76 #endif 77 77 78 #if GENERIC_CHAPTER_SUPPORT79 78 dvd_current_title = -1; 80 #endif81 79 82 80 MyProcess::start(); … … 158 156 static QRegExp rx_video("^ID_VID_(\\d+)_(LANG|NAME)=(.*)"); 159 157 static QRegExp rx_title("^ID_DVD_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)"); 158 static QRegExp rx_chapters("^ID_CHAPTER_(\\d+)_(START|END|NAME)=(.+)"); 160 159 static QRegExp rx_winresolution("^VO: \\[(.*)\\] (\\d+)x(\\d+) => (\\d+)x(\\d+)"); 161 160 static QRegExp rx_ao("^AO: \\[(.*)\\]"); … … 266 265 if (!notified_mplayer_is_running) { 267 266 qDebug("MplayerProcess::parseLine: starting sec: %f", sec); 268 #if GENERIC_CHAPTER_SUPPORT 269 if ( (md.chapters <= 0) && (dvd_current_title > 0) && 267 if ( (md.n_chapters <= 0) && (dvd_current_title > 0) && 270 268 (md.titles.find(dvd_current_title) != -1) ) 271 269 { 272 270 int idx = md.titles.find(dvd_current_title); 273 md.chapters = md.titles.itemAt(idx).chapters(); 274 qDebug("MplayerProcess::parseLine: setting chapters to %d", md.chapters); 275 } 276 #endif 271 md.n_chapters = md.titles.itemAt(idx).chapters(); 272 qDebug("MplayerProcess::parseLine: setting chapters to %d", md.n_chapters); 273 } 277 274 278 275 #if CHECK_VIDEO_CODEC_FOR_NO_VIDEO … … 550 547 int c = rx_mkvchapters.cap(1).toInt(); 551 548 qDebug("MplayerProcess::parseLine: mkv chapters: %d", c); 552 #if GENERIC_CHAPTER_SUPPORT 553 if ((c+1) > md.chapters) { 554 md.chapters = c+1; 555 qDebug("MplayerProcess::parseLine: chapters set to: %d", md.chapters); 556 } 557 #else 558 if ((c+1) > md.mkv_chapters) { 559 md.mkv_chapters = c+1; 560 qDebug("MplayerProcess::parseLine: mkv_chapters set to: %d", md.mkv_chapters); 561 } 562 #endif 549 if ((c+1) > md.n_chapters) { 550 md.n_chapters = c+1; 551 qDebug("MplayerProcess::parseLine: chapters set to: %d", md.n_chapters); 552 } 553 } 554 else 555 // Chapter info 556 if (rx_chapters.indexIn(line) > -1) { 557 int const chap_ID = rx_chapters.cap(1).toInt(); 558 QString const chap_type = rx_chapters.cap(2); 559 QString const chap_value = rx_chapters.cap(3); 560 double const chap_value_d = chap_value.toDouble(); 561 562 if(!chap_type.compare("START")) 563 { 564 md.chapters.addStart(chap_ID, chap_value_d/1000); 565 qDebug("MplayerProcess::parseLine: Chapter (ID: %d) starts at: %g",chap_ID, chap_value_d/1000); 566 } 567 else if(!chap_type.compare("END")) 568 { 569 md.chapters.addEnd(chap_ID, chap_value_d/1000); 570 qDebug("MplayerProcess::parseLine: Chapter (ID: %d) ends at: %g",chap_ID, chap_value_d/1000); 571 } 572 else if(!chap_type.compare("NAME")) 573 { 574 md.chapters.addName(chap_ID, chap_value); 575 qDebug("MplayerProcess::parseLine: Chapter (ID: %d) name: %s",chap_ID, chap_value.toUtf8().data()); 576 } 563 577 } 564 578 else … … 843 857 md.audio_codec = value; 844 858 } 845 #if GENERIC_CHAPTER_SUPPORT846 859 else 847 860 if (tag == "ID_CHAPTERS") { 848 md. chapters = value.toInt();861 md.n_chapters = value.toInt(); 849 862 #ifdef TOO_CHAPTERS_WORKAROUND 850 if (md. chapters > 1000) {851 qDebug("MplayerProcess::parseLine: warning too many chapters: %d", md. chapters);863 if (md.n_chapters > 1000) { 864 qDebug("MplayerProcess::parseLine: warning too many chapters: %d", md.n_chapters); 852 865 qDebug(" chapters will be ignored"); 853 md. chapters = 0;866 md.n_chapters = 0; 854 867 } 855 868 #endif … … 859 872 dvd_current_title = value.toInt(); 860 873 } 861 #endif862 874 } 863 875 }
Note:
See TracChangeset
for help on using the changeset viewer.