Ignore:
Timestamp:
Jan 24, 2017, 12:41:54 PM (8 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update trunk to version 17.1.0

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/mpvprocess.cpp

    r181 r188  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    5757        , dvd_current_title(-1)
    5858        , br_current_title(-1)
     59#ifdef OSD_WITH_TIMER
     60        , osd_timer(0)
     61#endif
    5962{
    6063        player_id = PlayerID::MPV;
     
    113116
    114117#ifdef CUSTOM_STATUS
    115 static QRegExp rx_mpv_av("^STATUS: ([0-9\\.-]+) / ([0-9\\.-]+) P: (yes|no) B: (yes|no) I: (yes|no)");
     118static QRegExp rx_mpv_av("^STATUS: ([0-9\\.-]+) / ([0-9\\.-]+) P: (yes|no) B: (yes|no) I: (yes|no) VB: ([0-9\\.-]+) AB: ([0-9\\.-]+)");
    116119#else
    117120static QRegExp rx_mpv_av("^(\\((.*)\\) |)(AV|V|A): ([0-9]+):([0-9]+):([0-9]+) / ([0-9]+):([0-9]+):([0-9]+)"); //AV: 00:02:15 / 00:09:56
     
    163166
    164167void MPVProcess::parseLine(QByteArray ba) {
    165         //qDebug("MPVProcess::parseLine: '%s'", ba.data() );
     168        //qDebug() << "MPVProcess::parseLine:" << ba;
    166169
    167170        if (ba.isEmpty()) return;
     
    201204                bool buffering = (rx_mpv_av.cap(4) == "yes");
    202205                bool idle = (rx_mpv_av.cap(5) == "yes");
     206                int video_bitrate = rx_mpv_av.cap(6).toInt();
     207                int audio_bitrate = rx_mpv_av.cap(7).toInt();
    203208
    204209                if (length != md.duration) {
     
    237242                }
    238243                notified_pause = false;
     244
     245                if (video_bitrate != md.video_bitrate) {
     246                        md.video_bitrate = video_bitrate;
     247                        emit receivedVideoBitrate(video_bitrate);
     248                }
     249                if (audio_bitrate != md.audio_bitrate) {
     250                        md.audio_bitrate = audio_bitrate;
     251                        emit receivedAudioBitrate(audio_bitrate);
     252                }
    239253
    240254                #else
     
    359373
    360374                        // Wait some secs to ask for bitrate
     375                        /*
    361376                        QTimer::singleShot(12000, this, SLOT(requestBitrateInfo()));
     377                        */
    362378                }
    363379
     
    720736                        }
    721737                        else
     738                        if (tag == "INFO_STREAM_PATH") {
     739                                QRegExp rx("edl://%\\d+%(.*)");
     740                                if (rx.indexIn(line) > -1) {
     741                                        md.stream_path = rx.cap(1);
     742                                } else {
     743                                        md.stream_path = value;
     744                                }
     745                        }
     746                        else
    722747                        if (tag == "MPV_VERSION") {
    723748                                mpv_version = value;
    724                                 //qDebug("MPVProcess::parseLine: mpv version: %s", mpv_version.toUtf8().constData());
     749                                if (mpv_version.startsWith("mpv ")) mpv_version = mpv_version.mid(4);
     750                                qDebug() << "MPVProcess::parseLine: mpv version:" << mpv_version;
     751                                MplayerVersion::mplayerVersion("mpv " + mpv_version + " (C)");
    725752                        }
    726753#if NOTIFY_VIDEO_CHANGES || NOTIFY_AUDIO_CHANGES || NOTIFY_SUB_CHANGES
     
    746773}
    747774
     775/*
    748776void MPVProcess::requestBitrateInfo() {
    749777        writeToStdin("print_text INFO_VIDEO_BITRATE=${=video-bitrate}");
    750778        writeToStdin("print_text INFO_AUDIO_BITRATE=${=audio-bitrate}");
    751779}
     780*/
    752781
    753782#if NOTIFY_AUDIO_CHANGES
Note: See TracChangeset for help on using the changeset viewer.