Hello community,
here is the log from the commit of package QMPlay2 for openSUSE:Factory checked in at 2015-08-03 17:20:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/QMPlay2 (Old)
and /work/SRC/openSUSE:Factory/.QMPlay2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "QMPlay2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/QMPlay2/QMPlay2.changes 2015-07-12 22:52:30.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.QMPlay2.new/QMPlay2.changes 2015-08-03 17:21:29.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Jul 13 18:06:19 UTC 2015 - dap.darkness@gmail.com
+
+- Update to 15.07.13 (changes since 15.06.26):
+ * fixed problem with playing video
+ (sometimes video plays at maximum speed).
+
+-------------------------------------------------------------------
Old:
----
QMPlay2-src-15.06.26.tar.bz2
New:
----
QMPlay2-src-15.07.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ QMPlay2.spec ++++++
--- /var/tmp/diff_new_pack.Ys3e0U/_old 2015-08-03 17:21:29.000000000 +0200
+++ /var/tmp/diff_new_pack.Ys3e0U/_new 2015-08-03 17:21:29.000000000 +0200
@@ -17,7 +17,7 @@
Name: QMPlay2
-Version: 15.06.26
+Version: 15.07.13
Release: 0
Summary: A Qt based media player, streamer and downloader
License: LGPL-3.0+
@@ -63,7 +63,6 @@
%prep
%setup -q -n %{name}-src
-
%build
export QT_SUFFIX="-qt5"
NOTERM=1 SYSTEM_BUILD=1 ./compile_unix `echo "%{?_smp_mflags}" | grep -o '[0-9]*'`
@@ -88,12 +87,10 @@
# Setting icon to 'pixmaps' instead of 'icons'.
mv %{buildroot}/%{_datadir}/{icons,pixmaps}
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
%files
%defattr(-,root,root)
%doc COPYING TODO
++++++ QMPlay2-src-15.06.26.tar.bz2 -> QMPlay2-src-15.07.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/ChangeLog new/QMPlay2-src/ChangeLog
--- old/QMPlay2-src/ChangeLog 2015-06-26 15:43:44.000000000 +0200
+++ new/QMPlay2-src/ChangeLog 2015-07-12 23:27:07.000000000 +0200
@@ -1,3 +1,14 @@
+Changes in QMPlay2 build 15.07.13:
+ - fixed problem from previous release with playing video (sometimes video plays at maximum speed),
+
+Changes in QMPlay2 build 15.07.12:
+ - keyboard shortcut (Shift+L) for locking widgets,
+ - fixed seeking by searching key frames in buffer,
+ - aspect ratio is now correctly updated,
+ - fixed playback in live streams,
+ - small fixes in video playback,
+ - VAApi bugfix,
+
Changes in QMPlay2 build 15.06.26:
- better VSync support for OpenGL video output,
- OpenSLES audio output (for Android),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/TODO new/QMPlay2-src/TODO
--- old/QMPlay2-src/TODO 2015-06-05 14:17:33.000000000 +0200
+++ new/QMPlay2-src/TODO 2015-07-11 13:55:16.000000000 +0200
@@ -1,3 +1,4 @@
+HEVC (H.265) on VA-API and VDPAU
Touch screen support: scrolling
Better radio stations
YouTube playlists
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/compile_unix new/QMPlay2-src/compile_unix
--- old/QMPlay2-src/compile_unix 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/compile_unix 2015-07-11 14:07:07.000000000 +0200
@@ -25,7 +25,7 @@
fi
fi
-# lupdate$QT_SUFFIX -locations none QMPlay2.pro
+# lupdate-qt4 -locations none QMPlay2.pro
lrelease$QT_SUFFIX QMPlay2.pro
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/lang/de.ts new/QMPlay2-src/lang/de.ts
--- old/QMPlay2-src/lang/de.ts 2015-06-25 01:24:35.000000000 +0200
+++ new/QMPlay2-src/lang/de.ts 2015-07-11 14:07:10.000000000 +0200
@@ -2414,8 +2414,8 @@
<translation>Nicht unterstützter De-Interlacing-Algorithmus</translation>
</message>
<message>
- <source>Nie można otworzyć filtrów usuwających przeplot</source>
- <translation>Kann den Filter zum Entfernen von Zeilensprung nicht öffnen</translation>
+ <source>Nie można otworzyć filtrów obrazu</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/lang/en.ts new/QMPlay2-src/lang/en.ts
--- old/QMPlay2-src/lang/en.ts 2015-06-25 01:24:42.000000000 +0200
+++ new/QMPlay2-src/lang/en.ts 2015-07-11 14:07:10.000000000 +0200
@@ -2400,8 +2400,8 @@
<translation>Not supported deinterlacing algorithm</translation>
</message>
<message>
- <source>Nie można otworzyć filtrów usuwających przeplot</source>
- <translation>Cannot open deinterlacing filters</translation>
+ <source>Nie można otworzyć filtrów obrazu</source>
+ <translation>Cannot open video filters</translation>
</message>
</context>
<context>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/lang/fr.ts new/QMPlay2-src/lang/fr.ts
--- old/QMPlay2-src/lang/fr.ts 2015-06-25 01:24:55.000000000 +0200
+++ new/QMPlay2-src/lang/fr.ts 2015-07-11 14:07:10.000000000 +0200
@@ -2400,8 +2400,8 @@
<translation>Algorithme de désentrelacement non supporté</translation>
</message>
<message>
- <source>Nie można otworzyć filtrów usuwających przeplot</source>
- <translation>Ne peut ouvrir les filtres de désentrelacement</translation>
+ <source>Nie można otworzyć filtrów obrazu</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/lang/ru.ts new/QMPlay2-src/lang/ru.ts
--- old/QMPlay2-src/lang/ru.ts 2015-06-25 01:24:50.000000000 +0200
+++ new/QMPlay2-src/lang/ru.ts 2015-07-11 14:07:10.000000000 +0200
@@ -2400,8 +2400,8 @@
<translation>Алгоритм деинтерлейсинга не поддерживается</translation>
</message>
<message>
- <source>Nie można otworzyć filtrów usuwających przeplot</source>
- <translation>Не удалось открыть фильтры деинтерлейсинга</translation>
+ <source>Nie można otworzyć filtrów obrazu</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/AVThread.cpp new/QMPlay2-src/src/gui/AVThread.cpp
--- old/QMPlay2-src/src/gui/AVThread.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/gui/AVThread.cpp 2015-07-12 23:15:11.000000000 +0200
@@ -39,19 +39,28 @@
if ( !mutex.tryLock( MUTEXWAIT_TIMEOUT ) )
{
emit QMPlay2Core.waitCursor();
- bool ret = mutex.tryLock( MUTEXWAIT_TIMEOUT );
+ const bool ret = mutex.tryLock( MUTEXWAIT_TIMEOUT );
emit QMPlay2Core.restoreCursor();
- return ret;
+ if ( !ret )
+ {
+ br2 = false;
+ return false;
+ }
}
return true;
}
+void AVThread::unlock()
+{
+ br2 = false;
+ mutex.unlock();
+}
void AVThread::stop( bool _terminate )
{
if ( _terminate )
return terminate();
- br = br2 = true;
+ br = true;
mutex.unlock();
playC.emptyBufferCond.wakeAll();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/AVThread.hpp new/QMPlay2-src/src/gui/AVThread.hpp
--- old/QMPlay2-src/src/gui/AVThread.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/gui/AVThread.hpp 2015-07-12 19:27:28.000000000 +0200
@@ -20,10 +20,7 @@
}
bool lock();
- inline void unlock()
- {
- mutex.unlock();
- }
+ void unlock();
inline bool isWaiting() const
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/AudioThr.cpp new/QMPlay2-src/src/gui/AudioThr.cpp
--- old/QMPlay2-src/src/gui/AudioThr.cpp 2015-06-21 00:01:00.000000000 +0200
+++ new/QMPlay2-src/src/gui/AudioThr.cpp 2015-07-12 19:50:35.000000000 +0200
@@ -221,7 +221,6 @@
int decodedSize = decoded.size();
int decodedPos = 0;
- br2 = false;
while ( decodedSize > 0 && !playC.paused && !br && !br2 )
{
const double max_len = 0.02; //TODO: zrobić opcje?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/DemuxerThr.cpp new/QMPlay2-src/src/gui/DemuxerThr.cpp
--- old/QMPlay2-src/src/gui/DemuxerThr.cpp 2015-06-05 01:49:53.000000000 +0200
+++ new/QMPlay2-src/src/gui/DemuxerThr.cpp 2015-07-12 23:24:59.000000000 +0200
@@ -445,7 +445,7 @@
Packet packet;
int streamIdx = -1;
- if ( demuxer->read( packet, streamIdx, packet.ts, packet.duration ) )
+ if ( demuxer->read( packet, streamIdx ) )
{
qApp->processEvents();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/MainWidget.cpp new/QMPlay2-src/src/gui/MainWidget.cpp
--- old/QMPlay2-src/src/gui/MainWidget.cpp 2015-06-25 00:02:59.000000000 +0200
+++ new/QMPlay2-src/src/gui/MainWidget.cpp 2015-07-12 14:18:58.000000000 +0200
@@ -259,7 +259,16 @@
if ( QMPlay2Core.getSettings().getBool( "MainWidget/TabPositionNorth" ) )
setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
- lockWidgets( QMPlay2Core.getSettings().getBool( "MainWidget/WidgetsLocked", false ) );
+
+ const bool widgetsLocked = QMPlay2Core.getSettings().getBool( "MainWidget/WidgetsLocked", false ) ;
+ lockWidgets( widgetsLocked );
+ lockWidgetsAct = new QAction( tr( "&Zablokuj widgety" ), menuBar );
+ lockWidgetsAct->setCheckable( true );
+ lockWidgetsAct->setAutoRepeat( false );
+ lockWidgetsAct->setChecked( widgetsLocked );
+ lockWidgetsAct->setShortcut( QKeySequence( "Shift+L" ) );
+ connect( lockWidgetsAct, SIGNAL( triggered( bool ) ), this, SLOT( lockWidgets( bool ) ) );
+ addAction( lockWidgetsAct );
fullScreenDockWidgetState = QMPlay2Core.getSettings().getByteArray( "MainWidget/FullScreenDockWidgetState" );
#if defined Q_OS_MAC || defined Q_OS_ANDROID
@@ -1003,18 +1012,23 @@
void MainWidget::lockWidgets( bool l )
{
- foreach ( QObject *o, children() )
+ if ( fullScreen || isCompactView )
+ qobject_cast< QAction * >( sender() )->setChecked( !l );
+ else
{
- DockWidget *dW = dynamic_cast< DockWidget * >( o );
- if ( dW )
+ foreach ( QObject *o, children() )
{
- if ( dW->isFloating() )
- dW->setFloating( false );
- dW->setGlobalTitleBarVisible( !l );
+ DockWidget *dW = dynamic_cast< DockWidget * >( o );
+ if ( dW )
+ {
+ if ( dW->isFloating() )
+ dW->setFloating( false );
+ dW->setGlobalTitleBarVisible( !l );
+ }
}
+ mainTB->setMovable( !l );
+ QMPlay2Core.getSettings().set( "MainWidget/WidgetsLocked", l );
}
- mainTB->setMovable( !l );
- QMPlay2Core.getSettings().set( "MainWidget/WidgetsLocked", l );
}
void MainWidget::hideDocksSlot()
@@ -1053,12 +1067,12 @@
QMenu *MainWidget::createPopupMenu()
{
QMenu *popupMenu = QMainWindow::createPopupMenu();
- popupMenu->addSeparator();
- QAction *act = popupMenu->addAction( tr( "&Zablokuj widgety" ) );
- act->setCheckable( true );
- act->setChecked( QMPlay2Core.getSettings().getBool( "MainWidget/WidgetsLocked" ) );
- connect( act, SIGNAL( triggered( bool ) ), this, SLOT( lockWidgets( bool ) ) );
- foreach ( act, popupMenu->actions() )
+ if ( !fullScreen && !isCompactView )
+ {
+ popupMenu->addSeparator();
+ popupMenu->addAction( lockWidgetsAct );
+ }
+ foreach ( QAction *act, popupMenu->actions() )
act->setEnabled( isVisible() && !fullScreen && !isCompactView );
return popupMenu;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/MainWidget.hpp new/QMPlay2-src/src/gui/MainWidget.hpp
--- old/QMPlay2-src/src/gui/MainWidget.hpp 2015-06-24 20:12:47.000000000 +0200
+++ new/QMPlay2-src/src/gui/MainWidget.hpp 2015-07-12 13:41:50.000000000 +0200
@@ -137,6 +137,8 @@
AboutWidget *aboutW;
bool isCompactView, wasShow, fullScreen;
+ QAction *lockWidgetsAct;
+
#ifdef UPDATER
Updater updater;
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/PacketBuffer.cpp new/QMPlay2-src/src/gui/PacketBuffer.cpp
--- old/QMPlay2-src/src/gui/PacketBuffer.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/gui/PacketBuffer.cpp 2015-07-12 23:19:59.000000000 +0200
@@ -30,7 +30,7 @@
durationToChange += pkt.duration;
sizeToChange += pkt.size();
}
- else
+ else if ( pkt.hasKeyFrame )
{
remaining_duration -= durationToChange;
backward_duration += durationToChange;
@@ -46,7 +46,7 @@
const Packet &pkt = at( i );
durationToChange += pkt.duration;
sizeToChange += pkt.size();
- if ( pkt.ts <= seek_pos )
+ if ( pkt.hasKeyFrame && pkt.ts <= seek_pos )
{
remaining_duration += durationToChange;
backward_duration -= durationToChange;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/PlayClass.cpp new/QMPlay2-src/src/gui/PlayClass.cpp
--- old/QMPlay2-src/src/gui/PlayClass.cpp 2015-06-26 00:22:11.000000000 +0200
+++ new/QMPlay2-src/src/gui/PlayClass.cpp 2015-07-11 20:55:58.000000000 +0200
@@ -103,7 +103,7 @@
Brightness = Saturation = Contrast = Hue = 0;
connect( &timTerminate, SIGNAL( timeout() ), this, SLOT( timTerminateFinished() ) );
- connect( this, SIGNAL( aRatioUpdate() ), this, SLOT( aRatioUpdated() ) );
+ connect( this, SIGNAL( aRatioUpdate( double ) ), this, SLOT( aRatioUpdated( double ) ) );
}
void PlayClass::play( const QString &_url )
@@ -829,13 +829,15 @@
}
}
-void PlayClass::aRatioUpdated() //jeżeli współczynnik proporcji zmieni się podczas odtwarzania
+void PlayClass::aRatioUpdated( double aRatio ) //jeżeli współczynnik proporcji zmieni się podczas odtwarzania
{
if ( aRatioName == "auto" && vThr && demuxThr && demuxThr->demuxer && videoStream > -1 )
{
+ demuxThr->demuxer->streamsInfo()[ videoStream ]->aspect_ratio = aRatio;
double aspect_ratio = getARatio();
if ( ass )
ass->setARatio( aspect_ratio );
+ vThr->setDeleteOSD();
vThr->setARatio( aspect_ratio );
vThr->processParams();
demuxThr->emitInfo();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/PlayClass.hpp new/QMPlay2-src/src/gui/PlayClass.hpp
--- old/QMPlay2-src/src/gui/PlayClass.hpp 2015-06-24 19:30:52.000000000 +0200
+++ new/QMPlay2-src/src/gui/PlayClass.hpp 2015-07-11 20:01:48.000000000 +0200
@@ -156,7 +156,7 @@
void screenShot();
void nextFrame();
- void aRatioUpdated();
+ void aRatioUpdated( double aRatio );
void demuxThrFinished();
@@ -164,7 +164,7 @@
void load( Demuxer * );
signals:
- void aRatioUpdate();
+ void aRatioUpdate( double aRatio );
void chText( const QString & );
void updateLength( int );
void updatePos( int );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/VideoThr.cpp new/QMPlay2-src/src/gui/VideoThr.cpp
--- old/QMPlay2-src/src/gui/VideoThr.cpp 2015-06-26 12:14:20.000000000 +0200
+++ new/QMPlay2-src/src/gui/VideoThr.cpp 2015-07-12 23:18:29.000000000 +0200
@@ -15,6 +15,7 @@
using Functions::gettime;
using Functions::s_wait;
+#include <QDebug>
#include <QImage>
#include <QDir>
@@ -94,7 +95,7 @@
Settings &QMPSettings = QMPlay2Core.getSettings();
if ( processParams )
- lock();
+ filtersMutex.lock();
filters.clear();
@@ -149,7 +150,7 @@
if ( processParams )
{
- unlock();
+ filtersMutex.unlock();
if ( writer && writer->hasParam( "Deinterlace" ) )
writer->processParams();
}
@@ -157,7 +158,12 @@
bool VideoThr::processParams()
{
- return writer ? writer->processParams() : false;
+ if ( writer )
+ {
+ lastSampleAspectRatio = writer->getParam( "AspectRatio" ).toDouble() / ( double )W * ( double )H;
+ return writer->processParams();
+ }
+ return false;
}
void VideoThr::updateSubs()
@@ -174,7 +180,7 @@
void VideoThr::run()
{
bool skip = false, paused = false, oneFrame = false, useLastDelay = false, lastOSDListEmpty = true;
- double tmp_time = 0.0, sync_last_pts = 0.0, frame_timer = 0.0, sync_timer = 0.0;
+ double tmp_time = 0.0, sync_last_pts = 0.0, frame_timer = -1.0, sync_timer = 0.0;
QMutex emptyBufferMutex;
QByteArray frame;
unsigned fast = 0;
@@ -186,6 +192,7 @@
if ( deleteFrame )
{
VideoFrame::unref( frame );
+ frame_timer = -1.0;
deleteFrame = false;
}
@@ -205,6 +212,7 @@
{
emit pause();
paused = true;
+ frame_timer = -1.0;
}
playC.vPackets.unlock();
@@ -218,7 +226,10 @@
emptyBufferMutex.lock();
playC.emptyBufferCond.wait( &emptyBufferMutex, MUTEXWAIT_TIMEOUT );
emptyBufferMutex.unlock();
- frame_timer = gettime();
+
+ if ( frame_timer != -1.0 )
+ frame_timer = gettime();
+
continue;
}
paused = waiting = false;
@@ -312,8 +323,12 @@
deleteSubs = deleteOSD = false;
/**/
+ filtersMutex.lock();
if ( playC.flushVideo )
+ {
filters.clearBuffers();
+ frame_timer = -1.0;
+ }
if ( !packet.isEmpty() )
{
@@ -332,10 +347,15 @@
}
const bool ptsIsValid = filters.getFrame( frame, packet.ts );
+ filtersMutex.unlock();
+
if ( packet.ts.isValid() )
{
- if ( dec->aspectRatioChanged() )
- emit playC.aRatioUpdate();
+ if ( packet.sampleAspectRatio && lastSampleAspectRatio != -1.0 && fabs( lastSampleAspectRatio - packet.sampleAspectRatio ) >= 0.000001 ) //zmiana współczynnika proporcji
+ {
+ lastSampleAspectRatio = -1.0; //Needs to be updated later
+ emit playC.aRatioUpdate( packet.sampleAspectRatio * ( double )W / ( double )H ); //Sets lastSampleAspectRatio because it calls processParams()
+ }
if ( ptsIsValid || packet.ts > playC.pos )
playC.chPos( packet.ts );
@@ -422,36 +442,34 @@
fast = 0;
}
- mutex.unlock();
-
if ( !frame.isEmpty() )
{
+ if ( frame_timer != -1.0 )
+ {
+ const double delay_diff = gettime() - frame_timer;
+ if ( syncVtoA && true_delay > 0.0 && delay_diff > true_delay )
+ ++fast;
+ delay -= delay_diff;
+ while ( delay > 0.0 && !playC.paused && !br && !br2 )
+ {
+ const double sleepTime = qMin( delay, 0.1 );
+ s_wait( sleepTime );
+ delay -= sleepTime;
+ }
+ }
if ( !skip && canWrite )
{
oneFrame = canWrite = false;
VideoFrame::ref( frame );
emit write( frame );
}
-
- const double delay_diff = gettime() - frame_timer;
- if ( syncVtoA && true_delay > 0.0 && delay_diff > true_delay )
- ++fast;
-
- delay -= delay_diff;
- while ( delay > 0.25 )
- {
- s_wait( 0.25 );
- if ( br || playC.flushVideo || br2 )
- delay = 0.0;
- else
- delay -= 0.25;
- }
- s_wait( delay );
+ frame_timer = gettime();
}
- frame_timer = gettime();
+ else if ( frame_timer != -1.0 )
+ frame_timer = gettime();
}
- else
- mutex.unlock();
+
+ mutex.unlock();
}
VideoFrame::unref( frame );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/gui/VideoThr.hpp new/QMPlay2-src/src/gui/VideoThr.hpp
--- old/QMPlay2-src/src/gui/VideoThr.hpp 2015-06-26 12:14:20.000000000 +0200
+++ new/QMPlay2-src/src/gui/VideoThr.hpp 2015-07-12 19:37:51.000000000 +0200
@@ -25,6 +25,10 @@
{
syncVtoA = b;
}
+ inline void setDeleteOSD()
+ {
+ deleteOSD = true;
+ }
void destroySubtitlesDecoder();
inline void setSubtitlesDecoder( Decoder *dec )
@@ -50,11 +54,13 @@
void run();
bool deleteSubs, syncVtoA, doScreenshot, canWrite, HWAccel, deleteOSD, deleteFrame;
+ double lastSampleAspectRatio;
int W, H;
Decoder *sDec;
QMPlay2_OSD *subtitles;
VideoFilters filters;
+ QMutex filtersMutex;
private slots:
void write_slot( const QByteArray & );
void screenshot_slot( const QByteArray & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/AudioCD/AudioCD.cpp new/QMPlay2-src/src/modules/AudioCD/AudioCD.cpp
--- old/QMPlay2-src/src/modules/AudioCD/AudioCD.cpp 2015-06-05 12:35:39.000000000 +0200
+++ new/QMPlay2-src/src/modules/AudioCD/AudioCD.cpp 2015-07-11 11:49:51.000000000 +0200
@@ -17,7 +17,7 @@
AudioCD::AudioCD() :
Module( "AudioCD" ),
cdioDestroyTimer( new CDIODestroyTimer ),
- AudioCDPlaylist( QDir::tempPath() + "/"AudioCDName".pls" )
+ AudioCDPlaylist( QDir::tempPath() + "/" AudioCDName".pls" )
{
moduleImg = QImage( ":/AudioCD" );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/AudioCD/AudioCD.pro new/QMPlay2-src/src/modules/AudioCD/AudioCD.pro
--- old/QMPlay2-src/src/modules/AudioCD/AudioCD.pro 2015-06-22 22:52:24.000000000 +0200
+++ new/QMPlay2-src/src/modules/AudioCD/AudioCD.pro 2015-07-12 21:32:25.000000000 +0200
@@ -12,7 +12,7 @@
QMAKE_LIBDIR += ../../../app/lib
}
-win32: LIBS += -Wl,-Bstatic -lcdio -lcddb -lregex -Wl,-Bdynamic -lwinmm -lws2_32
+win32: LIBS += -Wl,-Bstatic -lcdio -liconv -lcddb -lregex -Wl,-Bdynamic -lwinmm -lws2_32
else {
macx: QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.cpp new/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.cpp
--- old/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.cpp 2015-06-05 13:58:58.000000000 +0200
+++ new/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.cpp 2015-07-12 23:33:16.000000000 +0200
@@ -1,5 +1,7 @@
#include
+#include
+
#ifdef Q_OS_WIN
#include <QDir>
#else
@@ -155,7 +157,7 @@
{
return ( sector = s / duration ) < numSectors;
}
-bool AudioCDDemux::read( QByteArray &decoded, int &idx, TimeStamp &ts, double &duration )
+bool AudioCDDemux::read( Packet &decoded, int &idx )
{
if ( aborted || numSectors <= sector || isData )
return false;
@@ -169,8 +171,8 @@
decoded_data[ i ] = cd_samples[ i ] / 32768.0f;
idx = 0;
- duration = this->duration;
- ts = sector * duration;
+ decoded.ts = sector * duration;
+ decoded.duration = duration;
++sector;
return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.hpp new/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.hpp
--- old/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.hpp 2015-06-05 02:49:46.000000000 +0200
+++ new/QMPlay2-src/src/modules/AudioCD/AudioCDDemux.hpp 2015-07-11 00:49:02.000000000 +0200
@@ -51,7 +51,7 @@
int bitrate() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void abort();
bool open( const QString & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFCommon.cpp new/QMPlay2-src/src/modules/FFMpeg/FFCommon.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFCommon.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFCommon.cpp 2015-07-11 11:49:47.000000000 +0200
@@ -25,7 +25,7 @@
if ( url.left( 4 ) == "http" )
av_dict_set( &options, "icy", "1", 0 );
#endif
- av_dict_set( &options, "user-agent", "QMPlay2/"QMPlay2Version, 0 );
+ av_dict_set( &options, "user-agent", "QMPlay2/" QMPlay2Version, 0 );
if ( isLocal )
*isLocal = false;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDec.cpp new/QMPlay2-src/src/modules/FFMpeg/FFDec.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDec.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDec.cpp 2015-07-12 01:12:21.000000000 +0200
@@ -1,4 +1,6 @@
#include
+#include
+
#include
extern "C"
@@ -24,18 +26,6 @@
av_free( codec_ctx );
}
-bool FFDec::aspectRatioChanged() const
-{
- if ( codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO )
- {
- const int aspect_ratio = av_q2d( codec_ctx->sample_aspect_ratio ) * 1000;
- const bool b = last_aspect_ratio != aspect_ratio;
- last_aspect_ratio = aspect_ratio;
- return b;
- }
- return false;
-}
-
AVCodec *FFDec::init( StreamInfo *_streamInfo )
{
@@ -53,7 +43,7 @@
codec_ctx->pix_fmt = ( AVPixelFormat )streamInfo->img_fmt;
codec_ctx->coded_width = codec_ctx->width = streamInfo->W;
codec_ctx->coded_height = codec_ctx->height = streamInfo->H;
- // codec_ctx->debug_mv = FF_DEBUG_VIS_MV_P_FOR | FF_DEBUG_VIS_MV_B_FOR || FF_DEBUG_VIS_MV_B_BACK;
+// codec_ctx->debug_mv = FF_DEBUG_VIS_MV_P_FOR | FF_DEBUG_VIS_MV_B_FOR || FF_DEBUG_VIS_MV_B_BACK;
if ( codec->type != AVMEDIA_TYPE_SUBTITLE && !streamInfo->data.isEmpty() )
{
codec_ctx->extradata = ( uint8_t * )streamInfo->data.data();
@@ -75,7 +65,6 @@
switch ( codec_ctx->codec_type )
{
case AVMEDIA_TYPE_VIDEO:
- last_aspect_ratio = av_q2d( codec_ctx->sample_aspect_ratio ) * 1000.0;
case AVMEDIA_TYPE_AUDIO:
frame = av_frame_alloc();
break;
@@ -94,4 +83,17 @@
packet.pts = round( encodedPacket.ts.pts() / time_base );
if ( flush )
avcodec_flush_buffers( codec_ctx );
+ codec_ctx->reordered_opaque = ( int64_t & )encodedPacket.sampleAspectRatio;
+}
+void FFDec::decodeLastStep( Packet &encodedPacket, AVFrame *frame )
+{
+ const int64_t ts = av_frame_get_best_effort_timestamp( frame );
+ if ( ts != QMPLAY2_NOPTS_VALUE )
+ encodedPacket.ts = ts * time_base;
+ if ( codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO )
+ {
+ double &sampleAspectRatio = ( double & )frame->reordered_opaque;
+ if ( !sampleAspectRatio && frame->sample_aspect_ratio.num )
+ encodedPacket.sampleAspectRatio = av_q2d( frame->sample_aspect_ratio );
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDec.hpp new/QMPlay2-src/src/modules/FFMpeg/FFDec.hpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDec.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDec.hpp 2015-07-11 19:47:01.000000000 +0200
@@ -18,19 +18,17 @@
FFDec( QMutex & );
virtual ~FFDec();
- bool aspectRatioChanged() const;
-
/**/
AVCodec *init( StreamInfo *streamInfo );
bool openCodec( AVCodec *codec );
void decodeFirstStep( AVPacket &packet, const Packet &encodedPacket, bool flush );
+ void decodeLastStep( Packet &encodedPacket, AVFrame *frame );
AVCodecContext *codec_ctx;
AVFrame *frame;
double time_base;
- mutable int last_aspect_ratio;
bool codecIsOpen;
QMutex &avcodec_mutex;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDecHWAccel.cpp new/QMPlay2-src/src/modules/FFMpeg/FFDecHWAccel.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDecHWAccel.cpp 2015-06-10 21:02:50.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDecHWAccel.cpp 2015-07-11 19:46:30.000000000 +0200
@@ -46,8 +46,7 @@
if ( frameFinished )
{
VideoFrame::create( decoded, frame->data, frame->linesize, frame->interlaced_frame, frame->top_field_first );
- if ( frame->best_effort_timestamp != QMPLAY2_NOPTS_VALUE )
- encodedPacket.ts = frame->best_effort_timestamp * time_base;
+ decodeLastStep( encodedPacket, frame );
}
else
encodedPacket.ts.setInvalid();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDecSW.cpp new/QMPlay2-src/src/modules/FFMpeg/FFDecSW.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDecSW.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDecSW.cpp 2015-07-12 01:14:26.000000000 +0200
@@ -5,8 +5,6 @@
#include
#include
-#include <QThread> //to detect number of CPUs or CPU cores
-
extern "C"
{
#include
@@ -55,13 +53,9 @@
}
int _threads = sets().getInt( "Threads" );
- if ( _threads <= 0 )
- {
- _threads = QThread::idealThreadCount();
- if ( _threads < 1 )
- _threads = 1;
- }
- if ( _threads > 16 )
+ if ( _threads < 0 )
+ _threads = 0; //Autodetect by FFMpeg
+ else if ( _threads > 16 )
_threads = 16;
if ( threads != _threads )
{
@@ -204,10 +198,7 @@
}
if ( frameFinished )
- {
- if ( frame->best_effort_timestamp != QMPLAY2_NOPTS_VALUE )
- encodedPacket.ts = frame->best_effort_timestamp * time_base;
- }
+ decodeLastStep( encodedPacket, frame );
else
encodedPacket.ts.setInvalid();
@@ -289,8 +280,8 @@
if ( codec_ctx->pix_fmt == AV_PIX_FMT_NONE || streamInfo->W <= 0 || streamInfo->H <= 0 )
return false;
if ( codec->capabilities & CODEC_CAP_DR1 )
- codec_ctx->flags |= CODEC_FLAG_EMU_EDGE;
- if ( ( codec_ctx->thread_count = threads ) > 1 )
+ codec_ctx->flags |= CODEC_FLAG_EMU_EDGE; //Does nothing since FFMpeg 2.2
+ if ( ( codec_ctx->thread_count = threads ) != 1 )
{
if ( !thread_type_slice )
codec_ctx->thread_type = FF_THREAD_FRAME;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDemux.cpp new/QMPlay2-src/src/modules/FFMpeg/FFDemux.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDemux.cpp 2015-06-22 18:12:41.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDemux.cpp 2015-07-11 21:07:10.000000000 +0200
@@ -1,6 +1,8 @@
#include
#include
+#include
+
#include <QDebug>
extern "C"
@@ -292,7 +294,7 @@
}
return false;
}
-bool FFDemux::read( QByteArray &encoded, int &idx, TimeStamp &ts, double &duration )
+bool FFDemux::read( Packet &encoded, int &idx )
{
if ( aborted )
return false;
@@ -303,14 +305,14 @@
av_read_play( formatCtx );
}
- class Packet : public AVPacket
+ class AvQMPlay2Packet : public AVPacket
{
public:
- inline Packet()
+ inline AvQMPlay2Packet()
{
data = NULL;
}
- inline ~Packet()
+ inline ~AvQMPlay2Packet()
{
if ( data )
av_free_packet( this );
@@ -387,24 +389,28 @@
const double time_base = av_q2d( streams[ ff_idx ]->time_base );
if ( seekByByteOffset < 0 )
- ts.set( packet.dts * time_base, packet.pts * time_base, start_time );
+ encoded.ts.set( packet.dts * time_base, packet.pts * time_base, start_time );
else if ( packet.pos > -1 && length() > 0.0 )
- lastTime = ts = ( ( packet.pos - seekByByteOffset ) * length() ) / ( avio_size( formatCtx->pb ) - seekByByteOffset );
+ lastTime = encoded.ts = ( ( packet.pos - seekByByteOffset ) * length() ) / ( avio_size( formatCtx->pb ) - seekByByteOffset );
else
- ts = lastTime;
+ encoded.ts = lastTime;
if ( packet.duration > 0 )
- duration = packet.duration * time_base;
- else if ( !ts || ( duration = ts - lastTS ) < 0.0 /* Calculate packet duration if doesn't exists */ )
- duration = 0.0;
- lastTS = ts;
+ encoded.duration = packet.duration * time_base;
+ else if ( !encoded.ts || ( encoded.duration = encoded.ts - lastTS ) < 0.0 /* Calculate packet duration if doesn't exists */ )
+ encoded.duration = 0.0;
+ lastTS = encoded.ts;
- if ( isStreamed )
+ if ( isStreamed && isOneStreamOgg )
{
- ts = lastTime;
- lastTime += duration;
+ encoded.ts = lastTime;
+ lastTime += encoded.duration;
}
+ encoded.hasKeyFrame = packet.flags & AV_PKT_FLAG_KEY;
+ if ( streams[ ff_idx ]->sample_aspect_ratio.num )
+ encoded.sampleAspectRatio = av_q2d( streams[ ff_idx ]->sample_aspect_ratio );
+
idx = index_map.at( ff_idx );
return true;
@@ -463,6 +469,8 @@
if ( seekByByteOffset > -1 && ( isStreamed || name() != "mp3" ) )
seekByByteOffset = -1;
+ isOneStreamOgg = name() == "ogg" && formatCtx->nb_streams == 1;
+
if ( ( start_time = formatCtx->start_time / ( double )AV_TIME_BASE ) < 0.0 )
start_time = 0.0;
@@ -523,7 +531,6 @@
const AVCodecID codecID = stream->codec->codec_id;
if
(
- !stream ||
( stream->disposition & AV_DISPOSITION_ATTACHED_PIC ) ||
( stream->codec->codec_type == AVMEDIA_TYPE_DATA ) ||
( stream->codec->codec_type == AVMEDIA_TYPE_ATTACHMENT && codecID != AV_CODEC_ID_TTF && codecID != AV_CODEC_ID_OTF )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFDemux.hpp new/QMPlay2-src/src/modules/FFMpeg/FFDemux.hpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFDemux.hpp 2015-06-22 18:10:39.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFDemux.hpp 2015-07-11 21:07:10.000000000 +0200
@@ -1,5 +1,7 @@
#include
+#include
+
extern "C"
{
#include
@@ -34,7 +36,7 @@
bool localStream() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void pause();
void abort();
@@ -44,7 +46,7 @@
StreamInfo *getStreamInfo( AVStream *stream ) const;
AVDictionary *getMetadata() const;
-private:
+
QVector< int > index_map;
QList< AVStream * > streams;
AVFormatContext *formatCtx;
@@ -54,6 +56,7 @@
mutable bool isMetadataChanged;
double lastTime, start_time;
qint64 seekByByteOffset;
+ bool isOneStreamOgg;
int lastErr;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFMpeg.cpp new/QMPlay2-src/src/modules/FFMpeg/FFMpeg.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFMpeg.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFMpeg.cpp 2015-07-11 16:54:27.000000000 +0200
@@ -57,7 +57,9 @@
static bool firstTime = true;
if ( firstTime )
{
+#ifndef QT_DEBUG
av_log_set_level( AV_LOG_FATAL );
+#endif
av_register_all();
firstTime = false;
}
@@ -98,7 +100,7 @@
void *FFMpeg::createInstance( const QString &name )
{
if ( name == DemuxerName && getBool( "DemuxerEnabled" ) )
- return static_cast< Demuxer * >( new FFDemux( mutex, *this ) );
+ return new FFDemux( mutex, *this );
else if ( name == DecoderName && getBool( "DecoderEnabled" ) )
return new FFDecSW( mutex, *this );
#ifdef QMPlay2_VDPAU
@@ -114,7 +116,7 @@
return new FFDecVAAPI( mutex, *this );
#endif
else if ( name == FFReaderName )
- return new FFReader( *this );
+ return new FFReader;
return NULL;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFReader.cpp new/QMPlay2-src/src/modules/FFMpeg/FFReader.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFReader.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFReader.cpp 2015-07-11 16:54:22.000000000 +0200
@@ -13,12 +13,10 @@
/**/
-FFReader::FFReader( Module &module ) :
+FFReader::FFReader() :
avioCtx( NULL ),
aborted( false ), paused( false ), canRead( false )
-{
- SetModule( module );
-}
+{}
bool FFReader::readyRead() const
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/FFReader.hpp new/QMPlay2-src/src/modules/FFMpeg/FFReader.hpp
--- old/QMPlay2-src/src/modules/FFMpeg/FFReader.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/FFReader.hpp 2015-07-11 16:54:15.000000000 +0200
@@ -8,7 +8,7 @@
class FFReader : public Reader
{
public:
- FFReader( Module &module );
+ FFReader();
private:
bool readyRead() const;
bool canSeek() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.cpp new/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.cpp
--- old/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.cpp 2015-06-26 11:54:47.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.cpp 2015-07-11 14:06:52.000000000 +0200
@@ -142,7 +142,7 @@
#ifdef HAVE_VPP
if ( use_vpp )
{
- const bool do_vpp_deint = field != 0 && vpp_deint != VA_INVALID_ID;
+ const bool do_vpp_deint = field != 0 && vpp_buffers[ VAProcFilterDeinterlacing ] != VA_INVALID_ID;
bool vpp_ok = false;
if ( !do_vpp_deint )
@@ -159,10 +159,10 @@
if ( do_vpp_deint && !vpp_second )
{
VAProcFilterParameterBufferDeinterlacing *deint_params = NULL;
- if ( vaMapBuffer( VADisp, vpp_deint, ( void ** )&deint_params ) == VA_STATUS_SUCCESS )
+ if ( vaMapBuffer( VADisp, vpp_buffers[ VAProcFilterDeinterlacing ], ( void ** )&deint_params ) == VA_STATUS_SUCCESS )
{
deint_params->flags = field == VA_TOP_FIELD ? VPP_TFF : VPP_BFF;
- vaUnmapBuffer( VADisp, vpp_deint );
+ vaUnmapBuffer( VADisp, vpp_buffers[ VAProcFilterDeinterlacing ] );
}
}
@@ -175,13 +175,17 @@
memset( pipeline_param, 0, sizeof *pipeline_param );
pipeline_param->surface = curr_id;
pipeline_param->output_background_color = 0xFF000000;
- if ( do_vpp_deint )
+
+ pipeline_param->num_filters = 1;
+ if ( !do_vpp_deint )
+ pipeline_param->filters = &vpp_buffers[ VAProcFilterNone ];
+ else
{
- pipeline_param->num_filters = 1;
- pipeline_param->filters = &vpp_deint;
+ pipeline_param->filters = &vpp_buffers[ VAProcFilterDeinterlacing ];
pipeline_param->num_forward_references = 1;
pipeline_param->forward_references = &forward_reference;
}
+
vaUnmapBuffer( VADisp, pipeline_buf );
if ( vaBeginPicture( VADisp, context_vpp, id_vpp ) == VA_STATUS_SUCCESS )
{
@@ -498,6 +502,11 @@
num_filters = 0;
if ( num_filters )
{
+ /* Creating dummy filter (some drivers/api versions crashes without any filter) */
+ VAProcFilterParameterBufferBase none_params = { VAProcFilterNone };
+ if ( vaCreateBuffer( VADisp, context_vpp, VAProcFilterParameterBufferType, sizeof none_params, 1, &none_params, &vpp_buffers[ VAProcFilterNone ] ) != VA_STATUS_SUCCESS )
+ vpp_buffers[ VAProcFilterNone ] = VA_INVALID_ID;
+ /* Searching deinterlacing filter */
if ( vpp_deint_type != VAProcDeinterlacingNone )
for ( unsigned i = 0 ; i < num_filters ; ++i )
if ( filters[ i ] == VAProcFilterDeinterlacing )
@@ -534,16 +543,16 @@
if ( vpp_deint_type != VAProcDeinterlacingNone )
{
VAProcFilterParameterBufferDeinterlacing deint_params = { VAProcFilterDeinterlacing, vpp_deint_type, VPP_TFF };
- if ( vaCreateBuffer( VADisp, context_vpp, VAProcFilterParameterBufferType, sizeof deint_params, 1, &deint_params, &vpp_deint ) != VA_STATUS_SUCCESS )
- vpp_deint = VA_INVALID_ID;
+ if ( vaCreateBuffer( VADisp, context_vpp, VAProcFilterParameterBufferType, sizeof deint_params, 1, &deint_params, &vpp_buffers[ VAProcFilterDeinterlacing ] ) != VA_STATUS_SUCCESS )
+ vpp_buffers[ VAProcFilterDeinterlacing ] = VA_INVALID_ID;
}
break;
}
return;
}
}
- if ( vpp_deint_type != VAProcDeinterlacingNone )
- QMPlay2Core.log( tr( "Nie można otworzyć filtrów usuwających przeplot" ), ErrorLog | LogOnce );
+ if ( vpp_deint_type != VAProcDeinterlacingNone ) //Show error only when filter is required
+ QMPlay2Core.log( "VA-API :: " + tr( "Nie można otworzyć filtrów obrazu" ), ErrorLog | LogOnce );
clr_vpp();
#endif
}
@@ -696,8 +705,9 @@
#ifdef HAVE_VPP
if ( use_vpp )
{
- if ( vpp_deint != VA_INVALID_ID )
- vaDestroyBuffer( VADisp, vpp_deint );
+ for ( int i = 0 ; i < VAProcFilterCount ; ++i )
+ if ( vpp_buffers[ i ] != VA_INVALID_ID )
+ vaDestroyBuffer( VADisp, vpp_buffers[ i ] );
if ( id_vpp != VA_INVALID_SURFACE )
vaDestroySurfaces( VADisp, &id_vpp, 1 );
if ( context_vpp )
@@ -707,7 +717,8 @@
use_vpp = false;
}
id_vpp = forward_reference = VA_INVALID_SURFACE;
- vpp_deint = VA_INVALID_ID;
+ for ( int i = 0 ; i < VAProcFilterCount ; ++i )
+ vpp_buffers[ i ] = VA_INVALID_ID;
vpp_second = false;
context_vpp = 0;
config_vpp = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.hpp new/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.hpp
--- old/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.hpp 2015-06-10 21:07:48.000000000 +0200
+++ new/QMPlay2-src/src/modules/FFMpeg/VAApiWriter.hpp 2015-07-11 13:52:38.000000000 +0200
@@ -113,7 +113,7 @@
#ifdef HAVE_VPP //Postprocessing
VAContextID context_vpp;
VAConfigID config_vpp;
- VABufferID vpp_deint;
+ VABufferID vpp_buffers[ VAProcFilterCount ]; //TODO implement all filters
VAProcDeinterlacingType vpp_deint_type;
VASurfaceID id_vpp, forward_reference;
bool use_vpp, vpp_second;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/PCM.cpp new/QMPlay2-src/src/modules/Inputs/PCM.cpp
--- old/QMPlay2-src/src/modules/Inputs/PCM.cpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/PCM.cpp 2015-07-11 17:41:04.000000000 +0200
@@ -1,6 +1,7 @@
#include
#include
+#include
#include
/**/
@@ -61,12 +62,12 @@
int filePos = offset + s * srate * chn * bytes[ fmt ];
return reader->seek( filePos );
}
-bool PCM::read( QByteArray &decoded, int &idx, TimeStamp &ts, double &duration )
+bool PCM::read( Packet &decoded, int &idx )
{
if ( reader.isAborted() )
return false;
- ts = ( reader->pos() - offset ) / ( double )bytes[ fmt ] / chn / srate;
+ decoded.ts = ( reader->pos() - offset ) / ( double )bytes[ fmt ] / chn / srate;
QByteArray dataBA = reader->read( chn * bytes[ fmt ] * 256 );
const int samples_with_channels = dataBA.size() / bytes[ fmt ];
@@ -104,7 +105,7 @@
}
idx = 0;
- duration = decoded.size() / chn / sizeof( float ) / ( double )srate;
+ decoded.duration = decoded.size() / chn / sizeof( float ) / ( double )srate;
return decoded.size();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/PCM.hpp new/QMPlay2-src/src/modules/Inputs/PCM.hpp
--- old/QMPlay2-src/src/modules/Inputs/PCM.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/PCM.hpp 2015-07-11 00:48:37.000000000 +0200
@@ -19,7 +19,7 @@
int bitrate() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void abort();
bool open( const QString & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/Rayman2.cpp new/QMPlay2-src/src/modules/Inputs/Rayman2.cpp
--- old/QMPlay2-src/src/modules/Inputs/Rayman2.cpp 2015-06-20 23:45:05.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/Rayman2.cpp 2015-07-11 17:41:04.000000000 +0200
@@ -1,6 +1,7 @@
#include
#include
+#include
#include
/**/
@@ -104,12 +105,12 @@
}
return true;
}
-bool Rayman2::read( QByteArray &decoded, int &idx, TimeStamp &ts, double &duration )
+bool Rayman2::read( Packet &decoded, int &idx )
{
if ( reader.isAborted() )
return false;
- ts = ( reader->pos() - 0x64 ) * 2.0 / chn / srate;
+ decoded.ts = ( reader->pos() - 0x64 ) * 2.0 / chn / srate;
QByteArray sampleCodes = reader->read( chn * 256 );
for ( int i = 0 ; !reader.isAborted() && i + chn <= sampleCodes.size() ; i += chn )
@@ -124,7 +125,7 @@
return false;
idx = 0;
- duration = decoded.size() / chn / sizeof( float ) / ( double )srate;
+ decoded.duration = decoded.size() / chn / sizeof( float ) / ( double )srate;
return !reader.isAborted();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/Rayman2.hpp new/QMPlay2-src/src/modules/Inputs/Rayman2.hpp
--- old/QMPlay2-src/src/modules/Inputs/Rayman2.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/Rayman2.hpp 2015-07-11 00:49:11.000000000 +0200
@@ -17,7 +17,7 @@
int bitrate() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void abort();
bool open( const QString & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/ToneGenerator.cpp new/QMPlay2-src/src/modules/Inputs/ToneGenerator.cpp
--- old/QMPlay2-src/src/modules/Inputs/ToneGenerator.cpp 2015-06-05 13:38:52.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/ToneGenerator.cpp 2015-07-11 17:41:04.000000000 +0200
@@ -1,5 +1,7 @@
#include
+#include
+
#include <QUrl>
#if QT_VERSION < 0x050000
#define QUrlQuery( url ) url
@@ -76,7 +78,7 @@
{
return false;
}
-bool ToneGenerator::read( QByteArray &decoded, int &idx, TimeStamp &ts, double &duration )
+bool ToneGenerator::read( Packet &decoded, int &idx )
{
if ( aborted )
return false;
@@ -91,9 +93,9 @@
samples[ i+c ] = sin( 2.0 * M_PI * freqs[ c ] * i / srate / chn ); //don't use sinf()!
idx = 0;
- ts = pos;
- duration = 1.0;
- pos += duration;
+ decoded.ts = pos;
+ decoded.duration = 1.0;
+ pos += decoded.duration;
return true;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Inputs/ToneGenerator.hpp new/QMPlay2-src/src/modules/Inputs/ToneGenerator.hpp
--- old/QMPlay2-src/src/modules/Inputs/ToneGenerator.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/Inputs/ToneGenerator.hpp 2015-07-11 00:47:46.000000000 +0200
@@ -20,7 +20,7 @@
bool dontUseBuffer() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void abort();
bool open( const QString & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Modplug/MPDemux.cpp new/QMPlay2-src/src/modules/Modplug/MPDemux.cpp
--- old/QMPlay2-src/src/modules/Modplug/MPDemux.cpp 2015-06-20 23:55:58.000000000 +0200
+++ new/QMPlay2-src/src/modules/Modplug/MPDemux.cpp 2015-07-11 17:41:04.000000000 +0200
@@ -1,6 +1,8 @@
#include
-#include
+
#include
+#include
+#include
#include
@@ -110,7 +112,7 @@
pos = val;
return true;
}
-bool MPDemux::read( QByteArray &decoded, int &idx, TimeStamp &ts, double &duration )
+bool MPDemux::read( Packet &decoded, int &idx )
{
if ( aborted )
return false;
@@ -127,9 +129,9 @@
decodedFloat[ i ] = decodedInt[ i ] / 2147483648.0;
idx = 0;
- ts = pos;
- duration = ( double )decoded.size() / ( 44100*2*4 ); //SRATE * CHN * BITS/8
- pos += duration;
+ decoded.ts = pos;
+ decoded.duration = ( double )decoded.size() / ( 44100*2*4 ); //SRATE * CHN * BITS/8
+ pos += decoded.duration;
return true;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/modules/Modplug/MPDemux.hpp new/QMPlay2-src/src/modules/Modplug/MPDemux.hpp
--- old/QMPlay2-src/src/modules/Modplug/MPDemux.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/modules/Modplug/MPDemux.hpp 2015-07-11 00:47:25.000000000 +0200
@@ -23,7 +23,7 @@
int bitrate() const;
bool seek( int, bool );
- bool read( QByteArray &, int &, TimeStamp &, double & );
+ bool read( Packet &, int & );
void abort();
bool open( const QString & );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/qmplay2/headers/Decoder.hpp new/QMPlay2-src/src/qmplay2/headers/Decoder.hpp
--- old/QMPlay2-src/src/qmplay2/headers/Decoder.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/qmplay2/headers/Decoder.hpp 2015-07-11 16:34:34.000000000 +0200
@@ -19,7 +19,6 @@
virtual QString name() const = 0;
- virtual bool aspectRatioChanged() const { return false; }
virtual Writer *HWAccel() const { return NULL; }
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/qmplay2/headers/Demuxer.hpp new/QMPlay2-src/src/qmplay2/headers/Demuxer.hpp
--- old/QMPlay2-src/src/qmplay2/headers/Demuxer.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/qmplay2/headers/Demuxer.hpp 2015-07-11 00:50:07.000000000 +0200
@@ -4,10 +4,11 @@
#include
#include
#include
-#include
#include <QString>
+struct Packet;
+
class Demuxer : protected ModuleCommon, public BasicIO
{
public:
@@ -70,7 +71,7 @@
}
virtual bool seek( int, bool backward = false ) = 0;
- virtual bool read( QByteArray &, int &, TimeStamp &, double & ) = 0;
+ virtual bool read( Packet &, int & ) = 0;
virtual ~Demuxer() {}
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/qmplay2/headers/Packet.hpp new/QMPlay2-src/src/qmplay2/headers/Packet.hpp
--- old/QMPlay2-src/src/qmplay2/headers/Packet.hpp 2015-06-04 17:36:29.000000000 +0200
+++ new/QMPlay2-src/src/qmplay2/headers/Packet.hpp 2015-07-11 19:57:53.000000000 +0200
@@ -7,13 +7,19 @@
struct Packet : public QByteArray
{
+ inline Packet() :
+ sampleAspectRatio( 0.0 ),
+ hasKeyFrame( true )
+ {}
+
inline void reset()
{
*this = Packet();
}
TimeStamp ts;
- double duration;
+ double duration, sampleAspectRatio;
+ bool hasKeyFrame;
};
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src/src/qmplay2/headers/QMPlay2Core.hpp new/QMPlay2-src/src/qmplay2/headers/QMPlay2Core.hpp
--- old/QMPlay2-src/src/qmplay2/headers/QMPlay2Core.hpp 2015-06-26 15:43:37.000000000 +0200
+++ new/QMPlay2-src/src/qmplay2/headers/QMPlay2Core.hpp 2015-07-12 23:02:39.000000000 +0200
@@ -1,7 +1,7 @@
#ifndef QMPLAY2CORE_HPP
#define QMPLAY2CORE_HPP
-#define QMPlay2Version "15.06.26"
+#define QMPlay2Version "15.07.13"
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || (__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#define QMPLAY2_CPU_X86