Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DVD startup fixes.

- re-implement the dvdnav_first_play method that Stanley Skamithi added
some time ago and I removed some time later...

- minor tidy up of the CloseDVD method.

- use the dvdnav_first_play call when 're-starting' the dvd following
the codec scan.

Closes #9143
  • Loading branch information...
commit ec474d0b3eea4506b7a36612eea3397e054b406d 1 parent eecbc99
Mark Kendall authored
5 mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
View
@@ -262,6 +262,11 @@ dvdnav_status_t dvdnav_stop(dvdnav_t *self);
*********************************************************************/
/*
+ * Play DVD from the Beginning
+ */
+void dvdnav_first_play(dvdnav_t *self);
+
+/*
* Returns the number of titles on the disk.
*/
dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles);
8 mythtv/libs/libmythdvdnav/dvdnav/navigation.c
View
@@ -169,6 +169,14 @@ dvdnav_status_t dvdnav_current_title_program(dvdnav_t *this, int32_t *title, int
return DVDNAV_STATUS_ERR;
}
+void dvdnav_first_play(dvdnav_t *this) {
+ pthread_mutex_lock(&this->vm_lock);
+ this->started = 0;
+ vm_start(this->vm);
+ this->started = 1;
+ pthread_mutex_unlock(&this->vm_lock);
+}
+
dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int32_t title) {
return dvdnav_part_play(this, title, 1);
}
27 mythtv/libs/libmythtv/dvdringbuffer.cpp
View
@@ -141,6 +141,8 @@ void DVDRingBuffer::CloseDVD(void)
dvdnav_close(m_dvdnav);
m_dvdnav = NULL;
}
+ m_gotStop = false;
+ m_audioStreamsChanged = true;
}
void DVDRingBuffer::ClearChapterCache(void)
@@ -299,10 +301,7 @@ bool DVDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
rwlock.lockForWrite();
if (m_dvdnav)
- {
- dvdnav_close(m_dvdnav);
- m_dvdnav = NULL;
- }
+ CloseDVD();
filename = lfilename;
QByteArray fname = filename.toLocal8Bit();
@@ -412,9 +411,6 @@ bool DVDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
bool DVDRingBuffer::StartFromBeginning(void)
{
- if (!m_dvdnav)
- return false;
-
VERBOSE(VB_IMPORTANT, LOC + "Resetting DVD device.");
// if a DVDNAV_STOP event has been emitted, dvdnav_reset does not
@@ -424,20 +420,19 @@ bool DVDRingBuffer::StartFromBeginning(void)
VERBOSE(VB_IMPORTANT, LOC +
"DVD errored after initial scan - trying again");
CloseDVD();
- m_gotStop = false;
OpenFile(filename);
if (!m_dvdnav)
- {
VERBOSE(VB_IMPORTANT, LOC + "Failed to re-open DVD.");
- return false;
- }
}
- QMutexLocker lock(&m_seekLock);
- dvdnav_reset(m_dvdnav);
- dvdnav_title_play(m_dvdnav, 0);
- m_audioStreamsChanged = true;
- return true;
+ if (m_dvdnav)
+ {
+ QMutexLocker lock(&m_seekLock);
+ dvdnav_first_play(m_dvdnav);
+ m_audioStreamsChanged = true;
+ }
+
+ return m_dvdnav;
}
void DVDRingBuffer::GetChapterTimes(QList<long long> &times)
Please sign in to comment.
Something went wrong with that request. Please try again.