Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4718 closed patch (fixed)

DVD playback: don't assume that device name starts with /

Reported by: andrei@… Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch removes assumption that device names always start with '/'. It allows DVD playback on Win32.

As far as I can tell, this should not break any existing configuration or affect the behaviour on other platforms.

So far, I've only tested it with unencrypted DVD disk.

Attachments (2)

dvd_playback.patch (1006 bytes) - added by andrei@… 12 years ago.
dvd_playback_plugin.patch (1.0 KB) - added by andrei@… 12 years ago.

Download all attachments as: .zip

Change History (13)

Changed 12 years ago by andrei@…

Attachment: dvd_playback.patch added

Changed 12 years ago by andrei@…

Attachment: dvd_playback_plugin.patch added

comment:1 Changed 12 years ago by Nigel

The default in mythvideo/mythvideo/globalsettings.cpp is OK, but removing the extra slash in mythvideo/mythvideo/main.cpp is not needed. At the moment, Linux/Mac? pass in dvd://dev/blah, which although there is no approved URI scheme that refers to a DVD, it looks more like a proper URI than dvd:/dev/blah. [BR] Of course, dvd:/D: is just ugly, but MinGW also does /d, so dvd://d is a tidier option? [BR] I think the RingBuffer?.cpp code could be simplified thus:

Index: libs/libmythtv/RingBuffer.cpp
===================================================================
--- libs/libmythtv/RingBuffer.cpp       (revision 17486)
+++ libs/libmythtv/RingBuffer.cpp       (working copy)
@@ -181,16 +181,13 @@
         is_dvd = true;
         dvdPriv = new DVDRingBufferPriv();
         startreadahead = false;
-        int pathLen = filename.find("/", 4);
-        if (pathLen != -1)
-        {
-            QString tempFilename = filename.right(filename.length() -  pathLen);
 
-            QFile checkFile(tempFilename);
+        filename.remove(0,5);   // MythVideo calls with "dvd:/" + device
+        if (filename.length())
+        {
+            QFile checkFile(filename);
             if (!checkFile.exists())
                 filename = "/dev/dvd";
-            else
-                filename = tempFilename;
         }
         else
         {

Am testing now.

comment:2 Changed 12 years ago by Nigel

(In [17499]) Simplify dvd: device path processing. See #4718

comment:3 Changed 12 years ago by Nigel

Resolution: fixed
Status: newclosed

(In [17500]) implify dvd: device path processing. Closes #4718

comment:4 Changed 12 years ago by skamithi

Resolution: fixed
Status: closednew

playback of dvd in mythvideo gallery fails. the following change resolves the problem for me.

Index: RingBuffer.cpp
===================================================================
--- RingBuffer.cpp      (revision 17526)
+++ RingBuffer.cpp      (working copy)
@@ -182,7 +182,7 @@
         dvdPriv = new DVDRingBufferPriv();
         startreadahead = false;
 
-        filename.remove(0,5);     // MythVideo calls with "dvd:/" + device
+        filename.remove(0, 4);     // MythVideo calls with "dvd:/" + device
         if (filename.length())
         {
             QFile checkFile(filename);

the first "/" is been removed.

comment:5 Changed 12 years ago by skamithi

Owner: changed from Isaac Richards to Nigel
Status: newassigned

comment:6 Changed 12 years ago by Nigel

Stanley, I'll need some debug output (-v playback). Linux showed something like:

RingBuf(dvd://dev/dvd): OpenFile(dvd://dev/dvd, 12)

I just added some extra debug in trunk. Mac OS now does:

2008-06-22 17:19:37.867 RingBuf(dvd://dev/rdisk1): OpenFile(dvd://dev/rdisk1, 12)
2008-06-22 17:19:37.868 OpenFile() trying DVD at /dev/rdisk1

but that is the "Play DVD" button, not a gallery item (which I assume is a symlink in your VideoStartupDir??)

comment:7 Changed 12 years ago by skamithi

nigel, i added 2 debugs around the remove(0,5) function. the initial "/" is removed causing a file path check failure. this file is played from my mythvideo gallery. I can also reproduce the problem by typing

mythtv dvd:/home/mythtv/videos/KOIR
2008-06-22 07:18:11.762 XMLParse::LoadTheme using /usr/share/mythtv/themes/default/video-ui.xml
2008-06-22 07:18:15.557 TV: Attempting to change from None to WatchingPreRecorded
2008-06-22 07:18:15.557 DELETE ME BEFORE "remove" filename is dvd:/home/mythtv/videos/KOIR
2008-06-22 07:18:15.557 DELETE ME AFTER "remove" filename is home/mythtv/videos/KOIR
libdvdnav: Using dvdnav version 0.1.10-xine from http://xine.sf.net
libdvdread: Using libdvdcss version 1.2.9 for DVD access
libdvdread: Could not open /dev/dvd with libdvdcss.
libdvdread: Can't open /dev/dvd for reading
libdvdnav: vm: faild to open/read the DVD
2008-06-22 07:18:15.605 Failed to open DVD device at /dev/dvd

comment:8 Changed 12 years ago by Nigel

(In [17590]) Less restrictive DVD URI. e.g. dvd: dvd:/videos/blah dvd://dev/sda See #4718

comment:9 Changed 12 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [17591]) Less restrictive DVD URI. e.g. dvd: dvd:/videos/blah dvd://dev/sda Closes #4718

comment:10 Changed 12 years ago by Nigel

(In [17593]) Windows-specific DVD device name processing. See #4718

comment:11 Changed 12 years ago by Nigel

(In [17594]) Windows-specific DVD device name processing. See #4718

Note: See TracTickets for help on using tickets.