Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Mythtv protocol v41 extended

MythTV
2008-10-22
2013-06-03
  • Daan de Beer
    Daan de Beer
    2008-10-22

    Hello all,

    In changeset 18419, the mythtv protocol was extended with an additional 4 digit production year.

    See http://svn.mythtv.org/trac/changeset/18419 for details.

    I tried to make a patch for this extension, but I did not manage to get it working yet. Maybe you guys know what I did wrong.

    diff --git a/libs/libcmyth/cmyth_local.h b/libs/libcmyth/cmyth_local.h
    index 3ebb94a..6381d9a 100644
    --- a/libs/libcmyth/cmyth_local.h
    +++ b/libs/libcmyth/cmyth_local.h
    @@ -239,6 +239,7 @@ struct cmyth_proginfo {
            unsigned long proginfo_audioproperties; /* new in v35 */
            unsigned long proginfo_videoproperties; /* new in v35 */
            unsigned long proginfo_subtitletype; /* new in v35 */
    +       char *proginfo_prodyear; /* new in v41 */
    };

    struct cmyth_proglist {
    diff --git a/libs/libcmyth/proginfo.c b/libs/libcmyth/proginfo.c
    index 6553cbc..68e5f4f 100644
    --- a/libs/libcmyth/proginfo.c
    +++ b/libs/libcmyth/proginfo.c
    @@ -148,6 +148,9 @@ cmyth_proginfo_destroy(cmyth_proginfo_t p)
            if (p->proginfo_storagegroup) {
                    ref_release(p->proginfo_storagegroup);
            }
    +       if (p->proginfo_prodyear) {
    +               ref_release(p->proginfo_prodyear);
    +       }
            cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
    }

    @@ -344,6 +347,7 @@ cmyth_proginfo_dup(cmyth_proginfo_t p)
            ret->proginfo_audioproperties = p->proginfo_audioproperties;
            ret->proginfo_videoproperties = p->proginfo_videoproperties;
            ret->proginfo_subtitletype = p->proginfo_subtitletype;
    +       ret->proginfo_prodyear = p->proginfo_prodyear;
            cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
            return ret;
    }
    @@ -548,6 +552,10 @@ delete_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd)
                                    prog->proginfo_videoproperties,
                                    prog->proginfo_subtitletype);
                    }
    +               if (control->conn_version >=41) {
    +                   sprintf(buf + strlen(buf), "%s[]:[]",
    +                               prog->proginfo_prodyear);
    +               }
            }

            pthread_mutex_lock(&mutex);
    @@ -1354,6 +1362,11 @@ fill_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd)
                                prog->proginfo_videoproperties,
                                prog->proginfo_subtitletype);
                    }
    +               if(control->conn_version >= 41)
    +               {
    +                   sprintf(buf+strlen(buf),"%s[]:[]",
    +                           prog->proginfo_prodyear);
    +               }
            }

            if ((err = cmyth_send_message(control, buf)) < 0) {

    Regards,

    Daan de Beer

     
    • Daan de Beer
      Daan de Beer
      2008-10-22

      The following patch works for me:

      diff --git a/libs/libcmyth/cmyth_local.h b/libs/libcmyth/cmyth_local.h
      index 3ebb94a..6381d9a 100644
      --- a/libs/libcmyth/cmyth_local.h
      +++ b/libs/libcmyth/cmyth_local.h
      @@ -239,6 +239,7 @@ struct cmyth_proginfo {
           unsigned long proginfo_audioproperties; /* new in v35 */
           unsigned long proginfo_videoproperties; /* new in v35 */
           unsigned long proginfo_subtitletype; /* new in v35 */
      +    char *proginfo_prodyear; /* new in v41 */
      };

      struct cmyth_proglist {
      diff --git a/libs/libcmyth/proginfo.c b/libs/libcmyth/proginfo.c
      index 6553cbc..98c8649 100644
      --- a/libs/libcmyth/proginfo.c
      +++ b/libs/libcmyth/proginfo.c
      @@ -148,6 +148,9 @@ cmyth_proginfo_destroy(cmyth_proginfo_t p)
           if (p->proginfo_storagegroup) {
               ref_release(p->proginfo_storagegroup);
           }
      +    if (p->proginfo_prodyear) {
      +        ref_release(p->proginfo_prodyear);
      +    }
           cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
      }

      @@ -252,6 +255,7 @@ cmyth_proginfo_create(void)
           ret->proginfo_playgroup = NULL;
           ret->proginfo_storagegroup = NULL;
           ret->proginfo_recpriority_2 = NULL;
      +    ret->proginfo_prodyear = NULL;
           ret->proginfo_parentid = 0;
           cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
           return ret;
      @@ -344,6 +348,7 @@ cmyth_proginfo_dup(cmyth_proginfo_t p)
           ret->proginfo_audioproperties = p->proginfo_audioproperties;
           ret->proginfo_videoproperties = p->proginfo_videoproperties;
           ret->proginfo_subtitletype = p->proginfo_subtitletype;
      +    ret->proginfo_prodyear = p->proginfo_prodyear;
           cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
           return ret;
      }
      @@ -548,6 +553,10 @@ delete_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd)
                       prog->proginfo_videoproperties,
                       prog->proginfo_subtitletype);
               }       
      +        if (control->conn_version >=41) {
      +            sprintf(buf + strlen(buf), "%s[]:[]",
      +                prog->proginfo_prodyear);
      +        }       
           }

           pthread_mutex_lock(&mutex);
      @@ -1354,6 +1363,11 @@ fill_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd)
                       prog->proginfo_videoproperties,
                       prog->proginfo_subtitletype);
               }       
      +        if(control->conn_version >= 41)
      +        {
      +            sprintf(buf+strlen(buf),"%s[]:[]",
      +                prog->proginfo_prodyear);
      +        }       
           }

           if ((err = cmyth_send_message(control, buf)) < 0) {
      diff --git a/libs/libcmyth/socket.c b/libs/libcmyth/socket.c
      index 5e0c70f..f768faf 100644
      --- a/libs/libcmyth/socket.c
      +++ b/libs/libcmyth/socket.c
      @@ -2066,6 +2068,22 @@ cmyth_rcv_proginfo(cmyth_conn_t conn, int *err, cmyth_proginfo_t buf,
                   goto fail;
               }
           }   
      +    if (buf->proginfo_version >= 41) {
      +        /*
      +         * Get storagegroup (string)
      +         */
      +        consumed = cmyth_rcv_string(conn, err, tmp_str,
      +                        sizeof(tmp_str) - 1, count);
      +        count -= consumed;
      +        total += consumed;
      +        if (*err) {
      +            failed = "cmyth_rcv_string";
      +            goto fail;
      +        }
      +        if (buf->proginfo_prodyear)
      +            ref_release(buf->proginfo_prodyear);
      +        buf->proginfo_prodyear = ref_strdup(tmp_str);
      +    }
           cmyth_dbg(CMYTH_DBG_INFO, "%s: got recording info\n", __FUNCTION__);

           cmyth_proginfo_parse_url(buf);