• R/O
  • HTTP
  • SSH
  • HTTPS

rec10-git: Commit

rec10 git


Commit MetaInfo

Revision8df6d33319e095e41c426fb18223532acb814bdb (tree)
Time2013-12-14 14:54:41
Authorgn64_jp <gn64@rec1...>
Commitergn64_jp

Log Message

tunerec: now channel can be TE1/BS1/CS1 format

Change Summary

Incremental Difference

--- a/tunerec/tunerec.c
+++ b/tunerec/tunerec.c
@@ -314,20 +314,37 @@ void * record_write(void * priv) {
314314 int main(int argc, char *argv[]) {
315315 int adapter_nr;
316316 int channel_freq;
317+ int channel_phys;
317318 int channel_id;
318319 int fd;
319320 int ret;
320321 int rectime;
321322
322323 if (argc != 6) {
323- fprintf(stderr, "Usage : %s adapter_nr freq tsid rectime output\n", argv[0]);
324- fprintf(stderr, "Version: 0.0.1\n");
324+ fprintf(stderr, "Usage : %s adapter_nr channel tsid rectime output\n", argv[0]);
325+ fprintf(stderr, " channel can be freqency or channel(TE1/BS1/CS1)\n");
326+ fprintf(stderr, "Version: 0.0.2\n");
325327 return 1;
326328 }
327329 adapter_nr = strtol(argv[1], NULL, 0);
328330 channel_freq = strtol(argv[2], NULL, 10);
329331 channel_id = strtol(argv[3], NULL, 10);
330332 rectime = atoi(argv[4]);
333+
334+ if ( channel_freq == 0 ) {
335+ channel_phys = atoi(argv[2] + 2);
336+ if ( toupper(argv[2]) == 'T' && toupper(argv[2] + 1) == 'E' && channel_phys != 0 ) {
337+ channel_freq = ( 473 + (channel_phys - 13) * 6 ) * 1000000 + 142857;
338+ }
339+ else if ( toupper(argv[2]) == 'B' && toupper(argv[2] + 1) == 'S' && channel_phys != 0 ) {
340+ channel_freq = (channel_phys - 1) * 38360 / 2 + 1049480;
341+ }
342+ else if ( toupper(argv[2]) == 'C' && toupper(argv[2] + 1) == 'S' && channel_phys != 0 ) {
343+ channel_freq = (channel_phys - 2) * 40000 / 2 + 1613000;
344+ }
345+ fprintf(stderr, "channel_freq = %d\n", channel_freq);
346+ }
347+
331348 fd = search(adapter_nr, channel_freq, channel_id);
332349 if (fd < 0)
333350 return 1;
Show on old repository browser