[mythtv] [PATCH] mythvideo metadata reset

Adam Lewandowski adam at alewando.com
Tue Feb 15 02:04:45 UTC 2005


Related to this thread:
http://gossamer-threads.com/lists/mythtv/dev/19073

When browsing videos in file browser mode, Metadata.reset() is called 
instead of creating a new Metadata object. The reset method is setting 
default values incorrectly (or at least different from the constructor). 
Specifically, childID is being set to 1 instead of -1. This is causing 
the while loop at videotree.cpp, line 914 (playVideo()) to play the 
video at node 1 as soon as the selected video finished playing:

    while (parentItem->ChildID() > 0 && playing_time.elapsed() > 
WATCHED_WATERMARK)
    {
        childItem->setID(parentItem->ChildID());
        childItem->fillDataFromID(db);

        if (parentItem->ChildID() > 0)
        {
            //Load up data about this child
            command = getCommand(childItem);
            playing_time.start();
            myth_system((QString("%1 ") .arg(command)).local8Bit());
        }

        delete parentItem;
        parentItem = new Metadata(*childItem);
    }

This patch changes the Metadata::reset() method to match the default 
values in the Metadata constructor. In addition to childID, the year, 
userrating and browse members are set to match the constructor defaults.

-------------- next part --------------
Index: metadata.h
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/metadata.h,v
retrieving revision 1.16
diff -u -r1.16 metadata.h
--- metadata.h	9 Feb 2005 21:35:13 -0000	1.16
+++ metadata.h	15 Feb 2005 01:26:53 -0000
@@ -78,17 +78,17 @@
         filename = "";
         coverfile = "";
         title = "";
-        year = 1895;
+        year = 0;
         inetref = "";
         director = "";
         plot = "";
-        userrating = 0;
+        userrating = 0.0;
         rating = "";
         length = 0;
         showlevel = 1;
         id = 0;
-        childID = 1;
-        browse = 1;
+        childID = -1;
+        browse = true;
         playcommand = "";
         category = "";
         genres = QStringList();


More information about the mythtv-dev mailing list