Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Howto play DVDs with help of VDR
Hi,
playing DVDs with the same ease as using VDR to record and play movies was
one thing I had to have as soon as possible. For that reason, I did a very,
Very, VERY dirty implentation of using Matjaz Thaler's dvdplayer for the
DVB-s card.
Apologies first:
I'm currently doing a lot of stuff to the VDR source and therefore, cannot
send diffs that allow you to patch, but I thought this is an interesting
feature that some of you may want to have sooner than I can come up with
the other things.
The basic concept is:
Have a menu item in VDR that closes the video and vbi device, start Matjaz
Thaler's dvdplayer and once the dvdplayer comes back, reopen the video and
vbi device.
Caution:
If you have timers programmed during DVD playback, they are lost.
Requirements:
dvdplayer software from http://www2.arnes.si/~mthale1/index.html
tstdvd from the Livid source tree at http://www.linuxvideo.org
So what did I do:
Let's start with the dvdplayer
1. Get the dvdplayer sources from http://www2.arnes.si/~mthale1/index.html
2. In remote.c, you have to add a way to gracefully exit the dvdplayer. I
did it by adding
else if(!strcmp(ir.command,
MAKE_A_NEW_DEFINE_FOR_YOUR_DESIRED_EXIT_BUTTON_IN_REMOTE.H))
{
close(dev);
sleep(1); // if omitted, VDR may not be able to open the video when
one of
// the dvdplayer processes does not exit fast enough
break;
}
at the end of the while loop that retrieves IR codes.
Take the following shell script and put it in the dvdplayer directory
#!/bin/sh
cd /root/dvdplayer
umount /dvd
tstdvd /dev/dvd
mount /dvd
for i in 0 1 2; do
f=/dvd/video_ts/vts_01_$i.vob
test -f $f && break
done
tstdvd /dev/dvd $f
dvdplayer -a 1 -c -r -f $f
umount /dvd
Now the changes for VDR
Only menu.c, eit.c and eit.h is involved
In menu.c:
add #include "eit.h"
in Function cMenuMain::cMenuMain(bool Replaying):cOsdMenu("Main")
replace SetHelp("Record");
with SetHelp("Record", "DVD");
in Function eOSState cMenuMain::ProcessKey(eKeys Key)
add after the case kRed block
case kGreen: cDvbApi::Cleanup();
EIT.Close();
system("/root/dvdplayer/d"); // replace path with your
favourite ones
if (!cDvbApi::Init())
abort();
EIT.Open();
state = osEnd;
break;
In eit.c
Replace:
cEIT::cEIT()
{
cszBitFilter = "/dev/vbi";
if((fsvbi = open(cszBitFilter, O_RDWR))<0)
{
fsvbi = 0;
esyslog(LOG_ERR, "Failed to open DVB bitfilter device: %s",
cszBitFilter);
return;
}
}
cEIT::~cEIT()
{
if (fsvbi != 0)
close(fsvbi);
fsvbi = 0;
}
with
cEIT::cEIT()
{
Open();
}
cEIT::~cEIT()
{
Close();
}
/** */
bool cEIT::Open()
{
cszBitFilter = "/dev/vbi";
if((fsvbi = open(cszBitFilter, O_RDWR))<0)
{
fsvbi = 0;
cerr << "Failed to open DVB bitfilter device: " << cszBitFilter
<< endl;
return false;
}
return true;
}
/** */
bool cEIT::Close()
{
if (fsvbi != 0)
close(fsvbi);
fsvbi = 0;
return true;
}
and add
bool Close();
bool Open();
to the public section in eit.h
Home |
Main Index |
Thread Index