Ignore:
Timestamp:
Mar 29, 2012, 3:09:42 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update to latest svn

File:
1 edited

Legend:

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

    r121 r127  
    7676#endif
    7777
    78 #if GENERIC_CHAPTER_SUPPORT
    7978        dvd_current_title = -1;
    80 #endif
    8179
    8280        MyProcess::start();
     
    158156static QRegExp rx_video("^ID_VID_(\\d+)_(LANG|NAME)=(.*)");
    159157static QRegExp rx_title("^ID_DVD_TITLE_(\\d+)_(LENGTH|CHAPTERS|ANGLES)=(.*)");
     158static QRegExp rx_chapters("^ID_CHAPTER_(\\d+)_(START|END|NAME)=(.+)");
    160159static QRegExp rx_winresolution("^VO: \\[(.*)\\] (\\d+)x(\\d+) => (\\d+)x(\\d+)");
    161160static QRegExp rx_ao("^AO: \\[(.*)\\]");
     
    266265                if (!notified_mplayer_is_running) {
    267266                        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) &&
    270268                 (md.titles.find(dvd_current_title) != -1) )
    271269                        {
    272270                                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                        }
    277274
    278275#if CHECK_VIDEO_CODEC_FOR_NO_VIDEO
     
    550547                        int c = rx_mkvchapters.cap(1).toInt();
    551548                        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                        }
    563577                }
    564578                else
     
    843857                                md.audio_codec = value;
    844858                        }
    845 #if GENERIC_CHAPTER_SUPPORT
    846859                        else
    847860                        if (tag == "ID_CHAPTERS") {
    848                                 md.chapters = value.toInt();
     861                                md.n_chapters = value.toInt();
    849862                                #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);
    852865                                        qDebug("                           chapters will be ignored");
    853                                         md.chapters = 0;
     866                                        md.n_chapters = 0;
    854867                                }
    855868                                #endif
     
    859872                                dvd_current_title = value.toInt();
    860873                        }
    861 #endif
    862874                }
    863875        }
Note: See TracChangeset for help on using the changeset viewer.