[mythtv] DVB Code Update
Ben Bucksch
linux.news at bucksch.org
Wed Aug 27 06:53:11 EDT 2003
That's a lot better than the earlier versions. A few comments (I haven't
read through all the code):
perror("DVBChannel ERROR: Opening DVB frontend device failed!\n"\
"\tThe error was");
exit(-1);
You should not quit the backend just because you can't open a certain
device at a certain moment. Maybe I have several cards, maybe it's an
intermittend error. Quitting the backend makes it impossible to recover,
and may even break recordings in progress or scheduled (on other cards).
Instead, open it in the Open() function, let it return false and
eventually pass that back to the SetChannelByString() caller. Something
roughly like the patch I posted a few days ago.
Similarily, call dvbrecorder's CloseFilters in its Close().
if ( dvr_pids_size >= dvr_pids.size() )
Make this dvr_pids_next, please, because that's how it's used (I had
problems to read that code because of that).
dvb_channel_t dvbchannel;
In dvbchannel.h, you use that type, but never define it. It only happens
to compile, because you include the necessary header in all files where
you include the dvbchannel.h. Include dvbtypes.h in dvbchannel.h and use
#ifndef DVBTYPES_H guards as usual.
struct dvb_ofdm_parameters *p)
Better use a reference for out params, not a pointer.
dvr_pids.push_back(new dvb_dvr_pid_t);
No need to use a pointer.
cam = new DVBCam(cardnum, sections);
(in the constructor)
FYI, you could also get rid of those pointers by using the following:
DVBChannel& channel;
DVBSections sections;
DVBCam cam;
DVBRecorder::DVBRecorder(DVBChannel& aDVBChannel)
: RecorderBase(),
channel(aDVBChannel),
cardnum(0),
sections(),
cam(cardnum, sections)
but I guess the pointers are OK in this case.
if (name == "cardnum")
cardnum = value;
Notify the CAM class about this. As-is, the CAM stuff only works on the
first card (see above).
prev_params.u.ofdm.code_rate_HP !=
tuning->params.u.ofdm.code_rate_HP ||
prev_params.u.ofdm.code_rate_LP !=
tuning->params.u.ofdm.code_rate_LP ||
(and so on)
prev_params.u.ofdm != tuning->params.u.ofdm or even prev_params !=
tuning doesn't work?
More information about the mythtv-dev
mailing list