diff src/recpt1.c @ 133:0db6ccf0fe31

modify DLNA display name & UUID
author Naoya OYAMA <naoya.oyama@gmail.com>
date Thu, 14 Oct 2010 00:07:05 +0900
parents 5a380559a61e
children c4e0a5777363
line wrap: on
line diff
--- a/src/recpt1.c	Wed Oct 13 01:39:24 2010 +0900
+++ b/src/recpt1.c	Thu Oct 14 00:07:05 2010 +0900
@@ -54,7 +54,7 @@
 /* prototypes */
 int tune(char *channel, thread_data *tdata, char *device);
 int close_tuner(thread_data *tdata);
-
+static int get_device_id_by_name ( const char *name );
 
 /* ipc message receive */
 void *
@@ -972,6 +972,7 @@
     /* case 1: specified tuner device */
     if(device) {
         tdata->tfd = open(device, O_RDONLY);
+        tdata->device_id = get_device_id_by_name(device);
         if(tdata->tfd < 0) {
             fprintf(stderr, "Cannot open tuner device: %s\n", device);
             return 1;
@@ -1022,6 +1023,7 @@
                     continue;
                 }
 
+                tdata->device_id = get_device_id_by_name(tuner[lp]);
                 break; /* found suitable tuner */
             }
         }
@@ -1506,3 +1508,15 @@
     return 0;
 }
 
+static int
+get_device_id_by_name
+( const char *name )
+{
+    int i = -1;
+    if ( name != NULL ) {
+        if( ! strncmp(name, DEVICE_NAME_BASE, strlen(DEVICE_NAME_BASE) ) ) {
+            i = atoi(name+strlen(DEVICE_NAME_BASE));
+        }
+    }
+    return i;
+}