Ignore:
Timestamp:
May 3, 2016, 5:25:45 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.4

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/youtube/ytsig.cpp

    r170 r176  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    1818
    1919#include "ytsig.h"
     20#include <QtScript>
    2021
    21 #ifdef YT_USE_SCRIPT
    22 #include <QtScript>
     22QString YTSig::script_filename;
     23
     24QString YTSig::script;
     25QString YTSig::default_script;
     26
     27QString YTSig::parsed_ts;
     28
    2329
    2430QString YTSig::aclara(const QString & text, const QString & player, const QString & function_name) {
     
    5258        }
    5359
    54         //qDebug("YTSig::aclara: function_name: %s", function_name.toLatin1().constData());
     60        //qDebug() << "YTSig::aclara: function_name:" << function_name;
    5561
    5662        QScriptValue aclarar = engine.globalObject().property(fname);
     
    6066
    6167        if (res.isEmpty()) {
    62                 qDebug("YTSig::aclara: signature length not supported: %d: %s", text.size(), text.toLatin1().constData());
     68                qDebug() << "YTSig::aclara: signature length not supported:" << text.size() << ":" << text;
    6369        }
    6470
     
    6773
    6874void YTSig::reloadScriptFile() {
    69         qDebug("YTSig::reloadScriptFile: %s", script_file.toUtf8().constData());
     75        qDebug() << "YTSig::reloadScriptFile:" << script_filename;
    7076
    71         if (!QFile::exists(script_file)) {
    72                 qDebug("YTSig::reloadScriptFile: file doesn't exist.");
     77        if (!QFile::exists(script_filename)) {
     78                qDebug() << "YTSig::reloadScriptFile: file doesn't exist.";
    7379                return;
    7480        }
    7581
    76         QFile f(script_file);
     82        QFile f(script_filename);
    7783        f.open(QIODevice::ReadOnly);
    7884        QByteArray bytes = f.readAll();
     
    8793                if (rx.indexIn(bytes)) {
    8894                        QByteArray d = rx.cap(1).toLatin1();
    89                         //qDebug("YTSig::reloadScriptFile: d: %s", d.constData());
     95                        qDebug() << "YTSig::reloadScriptFile: d:" << d;
    9096                        parsed_ts = QByteArray::fromBase64(d);
    9197                }
     
    9399        }
    94100}
    95 
    96 QString YTSig::script;
    97 QString YTSig::script_file;
    98 
    99 QString YTSig::default_script;
    100 
    101 #else // YT_USE_SCRIPT
    102 
    103 #ifdef YTSIG_STATIC
    104 #include "ytsig_priv.cpp"
    105 #else
    106 QString YTSig::aclara(const QString & text, const QString & player, const QString & function_name) {
    107         QString res;
    108 
    109         int dot = text.indexOf('.');
    110         qDebug("YTSig::aclara (2): length: %d (%d.%d)", text.size(), dot, text.size()-dot-1);
    111 
    112         /*
    113         qDebug("%d: orig: %s", text.size(), text.toLatin1().constData());
    114         qDebug("%d: conv: %s", text.size(), res.toLatin1().constData());
    115         */
    116 
    117         return res;
    118 }
    119 #endif
    120 
    121 #endif // YT_USE_SCRIPT
    122101
    123102void YTSig::check(QString & u) {
     
    127106}
    128107
    129 QString YTSig::parsed_ts;
Note: See TracChangeset for help on using the changeset viewer.