Ignore:
Timestamp:
May 15, 2014, 7:53:54 PM (11 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update vendor to 0.8.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/mplayerprocess.cpp

    r154 r163  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    7777
    7878        dvd_current_title = -1;
     79        br_current_title = -1;
    7980
    8081        MyProcess::start();
     
    159160#endif
    160161static QRegExp rx_video("^ID_VID_(\\d+)_(LANG|NAME)=(.*)");
    161 static QRegExp rx_title("^ID_DVD_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)");
     162static QRegExp rx_title("^ID_(DVD|BLURAY)_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)");
    162163static QRegExp rx_chapters("^ID_CHAPTER_(\\d+)_(START|END|NAME)=(.+)");
    163164static QRegExp rx_winresolution("^VO: \\[(.*)\\] (\\d+)x(\\d+) => (\\d+)x(\\d+)");
     
    179180static QRegExp rx_fontcache("^\\[ass\\] Updating font cache|^\\[ass\\] Init");
    180181static QRegExp rx_scanning_font("Scanning file");
     182static QRegExp rx_forbidden("Server returned 403: Forbidden");
    181183#if DVDNAV_SUPPORT
    182184static QRegExp rx_dvdnav_switch_title("^DVDNAV, switched to title: (\\d+)");
     
    369371                // No video
    370372                if (rx_novideo.indexIn(line) > -1) {
    371                         md.novideo = TRUE;
     373                        md.novideo = true;
    372374                        emit receivedNoVideo();
    373375                        //emit mplayerFullyLoaded();
     
    621623                else
    622624
    623                 // DVD titles
     625                // DVD/Bluray titles
    624626                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);
    627629
    628630                        if (t=="LENGTH") {
    629                                 double length = rx_title.cap(3).toDouble();
     631                                double length = rx_title.cap(4).toDouble();
    630632                                qDebug("MplayerProcess::parseLine: Title: ID: %d, Length: '%f'", ID, length);
    631633                                md.titles.addDuration(ID, length);
     
    633635                        else
    634636                        if (t=="CHAPTERS") {
    635                                 int chapters = rx_title.cap(3).toInt();
     637                                int chapters = rx_title.cap(4).toInt();
    636638                                qDebug("MplayerProcess::parseLine: Title: ID: %d, Chapters: '%d'", ID, chapters);
    637639                                md.titles.addChapters(ID, chapters);
     
    639641                        else
    640642                        if (t=="ANGLES") {
    641                                 int angles = rx_title.cap(3).toInt();
     643                                int angles = rx_title.cap(4).toInt();
    642644                                qDebug("MplayerProcess::parseLine: Title: ID: %d, Angles: '%d'", ID, angles);
    643645                                md.titles.addAngles(ID, angles);
     
    770772                if (rx_scanning_font.indexIn(line) > -1) {
    771773                        emit receivedScanningFont(line);
     774                }
     775                else
     776
     777                if (rx_forbidden.indexIn(line) > -1) {
     778                        qDebug("MplayerProcess::parseLine: 403 forbidden");
     779                        emit receivedForbiddenText();
    772780                }
    773781                else
     
    807815                                md.duration = value.toDouble();
    808816                                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                                }
    809826                        }
    810827                        else
     
    887904                                dvd_current_title = value.toInt();
    888905                        }
     906                        else
     907                        if (tag == "ID_BLURAY_CURRENT_TITLE") {
     908                                br_current_title = value.toInt();
     909                        }
     910
    889911                }
    890912        }
Note: See TracChangeset for help on using the changeset viewer.