Changeset 163 for smplayer/vendor/current/src/mplayerprocess.cpp
- Timestamp:
- May 15, 2014, 7:53:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/mplayerprocess.cpp
r154 r163 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 3Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 77 77 78 78 dvd_current_title = -1; 79 br_current_title = -1; 79 80 80 81 MyProcess::start(); … … 159 160 #endif 160 161 static QRegExp rx_video("^ID_VID_(\\d+)_(LANG|NAME)=(.*)"); 161 static QRegExp rx_title("^ID_ DVD_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)");162 static QRegExp rx_title("^ID_(DVD|BLURAY)_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)"); 162 163 static QRegExp rx_chapters("^ID_CHAPTER_(\\d+)_(START|END|NAME)=(.+)"); 163 164 static QRegExp rx_winresolution("^VO: \\[(.*)\\] (\\d+)x(\\d+) => (\\d+)x(\\d+)"); … … 179 180 static QRegExp rx_fontcache("^\\[ass\\] Updating font cache|^\\[ass\\] Init"); 180 181 static QRegExp rx_scanning_font("Scanning file"); 182 static QRegExp rx_forbidden("Server returned 403: Forbidden"); 181 183 #if DVDNAV_SUPPORT 182 184 static QRegExp rx_dvdnav_switch_title("^DVDNAV, switched to title: (\\d+)"); … … 369 371 // No video 370 372 if (rx_novideo.indexIn(line) > -1) { 371 md.novideo = TRUE;373 md.novideo = true; 372 374 emit receivedNoVideo(); 373 375 //emit mplayerFullyLoaded(); … … 621 623 else 622 624 623 // DVD titles625 // DVD/Bluray titles 624 626 if (rx_title.indexIn(line) > -1) { 625 int ID = rx_title.cap( 1).toInt();626 QString t = rx_title.cap( 2);627 int ID = rx_title.cap(2).toInt(); 628 QString t = rx_title.cap(3); 627 629 628 630 if (t=="LENGTH") { 629 double length = rx_title.cap( 3).toDouble();631 double length = rx_title.cap(4).toDouble(); 630 632 qDebug("MplayerProcess::parseLine: Title: ID: %d, Length: '%f'", ID, length); 631 633 md.titles.addDuration(ID, length); … … 633 635 else 634 636 if (t=="CHAPTERS") { 635 int chapters = rx_title.cap( 3).toInt();637 int chapters = rx_title.cap(4).toInt(); 636 638 qDebug("MplayerProcess::parseLine: Title: ID: %d, Chapters: '%d'", ID, chapters); 637 639 md.titles.addChapters(ID, chapters); … … 639 641 else 640 642 if (t=="ANGLES") { 641 int angles = rx_title.cap( 3).toInt();643 int angles = rx_title.cap(4).toInt(); 642 644 qDebug("MplayerProcess::parseLine: Title: ID: %d, Angles: '%d'", ID, angles); 643 645 md.titles.addAngles(ID, angles); … … 770 772 if (rx_scanning_font.indexIn(line) > -1) { 771 773 emit receivedScanningFont(line); 774 } 775 else 776 777 if (rx_forbidden.indexIn(line) > -1) { 778 qDebug("MplayerProcess::parseLine: 403 forbidden"); 779 emit receivedForbiddenText(); 772 780 } 773 781 else … … 807 815 md.duration = value.toDouble(); 808 816 qDebug("MplayerProcess::parseLine: md.duration set to %f", md.duration); 817 // Use the bluray title length if duration is 0 818 if (md.duration == 0 && br_current_title != -1) { 819 int i = md.titles.find(br_current_title); 820 if (i != -1) { 821 double duration = md.titles.itemAt(i).duration(); 822 qDebug("MplayerProcess::parseLine: using the br title length: %f", duration); 823 md.duration = duration; 824 } 825 } 809 826 } 810 827 else … … 887 904 dvd_current_title = value.toInt(); 888 905 } 906 else 907 if (tag == "ID_BLURAY_CURRENT_TITLE") { 908 br_current_title = value.toInt(); 909 } 910 889 911 } 890 912 }
Note:
See TracChangeset
for help on using the changeset viewer.