void PlayerDriver::handleGetDurationComplete(PlayerGetDuration* cmd)
{
    cmd->set(-1);

    if (mMetaValueList.empty())
        return;

    MediaClockConverter mcc;

    for (uint32 i = 0; i < mMetaValueList.size(); ++i) {
        // Search for the duration
        char* substr=oscl_strstr(mMetaValueList[i].key, _STRLIT_CHAR("duration;valtype=uint32;timescale="));
        if (substr!=NULL) {
            uint32 timescale=1000;
            if (PV_atoi((substr+34), 'd', timescale) == false) {
                // Retrieving timescale failed so default to 1000
                timescale=1000;
            }
            uint32 duration = mMetaValueList[i].value.uint32_value;
            if (duration > 0 && timescale > 0) {
            //set the timescale
               mcc.set_timescale(timescale);
            //set the clock to the duration as per the timescale
               mcc.set_clock(duration,1);
            //convert to millisec
               cmd->set(mcc.get_converted_ts(1000));
            }
        }
    }
}
        // From NodeRegistrySharedLibraryInterface
        void UnregisterAllNodes(PVPlayerNodeRegistryInterface* aRegistry, OsclAny* aContext)
        {
            if (NULL != aContext)
            {
                Oscl_Vector<PVPlayerNodeInfo, OsclMemAllocator>* nodeList = (Oscl_Vector<PVPlayerNodeInfo, OsclMemAllocator> *)aContext;

                while (!nodeList->empty())
                {
                    PVPlayerNodeInfo tmpnode = nodeList->front();
                    OSCL_DELETE(tmpnode.iSharedLibrary);
                    aRegistry->UnregisterNode(tmpnode);
                    nodeList->erase(nodeList->begin());
                }

                delete nodeList;
            }
        };
        void UnregisterAllRecognizers(PVPlayerRecognizerRegistryInterface* aRegistry, OsclAny* aContext)
        {
            if (NULL != aContext)
            {
                Oscl_Vector<PVMFRecognizerPluginFactory*, OsclMemAllocator>* pluginList = (Oscl_Vector<PVMFRecognizerPluginFactory*, OsclMemAllocator>*)aContext;

                while (!pluginList->empty())
                {
                    PVMFRecognizerPluginFactory* tmpfac = pluginList->front();

                    aRegistry->UnregisterRecognizer(tmpfac);

                    pluginList->erase(pluginList->begin());

                    OSCL_DELETE(tmpfac);
                }

                delete pluginList;
            }
        };
        //Read and parse the config file
        //retval = -1 if the config file doesnt exist
        int8 ReadAndParseLoggerConfigFile()
        {
            int8 retval = 1;

            if (0 != iLogFile.Open(iLogFileName, Oscl_File::MODE_READ, iFileServer))
            {
                retval = -1;
            }
            else
            {
                if (!iLogFileRead)
                {
                    int32 nCharRead = iLogFile.Read(ibuffer, 1, sizeof(ibuffer));
                    //Parse the buffer for \n chars
                    Oscl_Vector<char*, OsclMemAllocator> LogConfigStrings;

                    const char *end_ptr = ibuffer + oscl_strlen(ibuffer) ; // Point just beyond the end
                    const char *section_start_ptr;
                    const char *line_start_ptr, *line_end_ptr;
                    char* end_temp_ptr;
                    int16 offset = 0;

                    section_start_ptr = skip_whitespace_and_line_term(ibuffer, end_ptr);

                    while (section_start_ptr < end_ptr)
                    {
                        if (!get_next_line(section_start_ptr, end_ptr,
                                           line_start_ptr, line_end_ptr))
                        {
                            break;
                        }


                        section_start_ptr = line_end_ptr + 1;

                        end_temp_ptr = (char*)line_end_ptr;
                        *end_temp_ptr = '\0';

                        LogConfigStrings.push_back((char*)line_start_ptr);

                    }

                    //Populate the  LoggerConfigElements vector
                    {
                        if (!LogConfigStrings.empty())
                        {
                            Oscl_Vector<char*, OsclMemAllocator>::iterator it;
                            it = LogConfigStrings.begin();
                            uint32 appenderType;
                            PV_atoi(*it, 'd', oscl_strlen(*it), appenderType);
                            iAppenderType = appenderType;
                            if (LogConfigStrings.size() > 1)
                            {
                                for (it = LogConfigStrings.begin() + 1; it != LogConfigStrings.end(); it++)
                                {
                                    char* CommaIndex = (char*)oscl_strstr(*it, ",");
                                    if (CommaIndex != NULL)
                                    {
                                        *CommaIndex = '\0';
                                        LoggerConfigElement obj;
                                        uint32 logLevel;
                                        PV_atoi(*it, 'd', oscl_strlen(*it), logLevel);
                                        obj.iLogLevel = logLevel;
                                        obj.iLoggerString = CommaIndex + 1;
                                        iLoggerConfigElements.push_back(obj);
                                    }
                                }
                            }
                            else
                            {
                                //Add the config element for complete logging fo all the modules
                                LoggerConfigElement obj;
                                obj.iLoggerString = "";
                                obj.iLogLevel = 8;
                                iLoggerConfigElements.push_back(obj);
                            }
                        }
                    }
                    iLogFile.Close();
                    iLogFileRead = true;
                }
            }
            return retval;
        }