Esempio n. 1
0
static int mls_eof(void* data)
{
    MultipleMediaSources* multSource = (MultipleMediaSources*)data;
    MediaSourceElement* ele = &multSource->sources;
    int eof = 0;
    int syncResult;

    /* make sure the sources are in sync */
    if ((syncResult = sync_sources(multSource)) != 0)
    {
        /* failure result is 0 and not the sync result */
        return 0;
    }

    while (ele != NULL && ele->source != NULL)
    {
        if (!SOURCE_IS_DISABLED(ele))
        {
            eof |= msc_eof(ele->source);
        }

        ele = ele->next;
    }

    return eof;
}
Esempio n. 2
0
static int cps_eof(void* data)
{
    ClipSource* clipSource = (ClipSource*)data;

    if (clipSource->duration >= 0)
    {
        if (msc_eof(clipSource->targetSource))
        {
            return 1;
        }

        int64_t position;
        if (!msc_get_position(clipSource->targetSource, &position))
        {
            return 0;
        }

        return position >= clipSource->start + clipSource->duration;
    }

    return msc_eof(clipSource->targetSource);
}