Changeset 46329


Ignore:
Timestamp:
11/06/22 18:10:32 (18 months ago)
Author:
gost
Message:

ext player... skip to last pos

Location:
titan/titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/player.h

    r46258 r46329  
    14111411        char * tmpfile = NULL;
    14121412        status.prefillbuffer = 0;
     1413        //float sec = 0;
     1414  int sec = 0;
    14131415       
    14141416        addconfig("lastplayertype", "0");
     1417       
     1418        free(status.actplay);
     1419        status.actplay = ostrcat(file, NULL, 0, 0);
     1420       
     1421        if(status.actplay != 0 && getconfigint("showlastpos", NULL) == 1)
     1422        {
     1423                        char* fileseek = changefilenameext(file, ".pts");
     1424                        FILE* fbseek = fopen(fileseek, "r");
     1425                        if(fbseek != NULL)
     1426                        {
     1427                                printf("++++ seek gefunden\n");
     1428                                if(textbox(_("Message"), _("Start at last position ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 5, 0) == 1)
     1429                                {
     1430                                        char* skip1 = calloc(1, 20);
     1431                                        if(skip1 != NULL)
     1432                                        {
     1433                                                fscanf(fbseek, "%s", skip1);
     1434                                                off64_t seekpos = atoll(skip1);
     1435                                                sec = seekpos / 90000;
     1436                                                printf("++++ seek sec: %d\n", sec);
     1437                                        }
     1438                                        free(skip1); skip1 = NULL;
     1439                                }
     1440                                fclose(fbseek);
     1441                        }
     1442                        free(fileseek); fileseek = NULL;
     1443        }       
    14151444       
    14161445#ifdef EPLAYER4
     
    16111640
    16121641                free(tmpfile);
    1613 
     1642 
     1643                if(sec > 0)
     1644                {
     1645                        usleep(100000);
     1646                        playerseek(sec);
     1647                }
    16141648                return 0;
    16151649#endif
     
    18281862                        sleep(1);
    18291863                        m_gst_startpts = playergetpts();
     1864                }
     1865
     1866                if(sec > 0)
     1867                {
     1868                        usleep(100000);
     1869                        playerseek(sec);
    18301870                }
    18311871
     
    22932333        if(player && player->playback)
    22942334                player->playback->Command(player, PLAYBACK_PLAY, NULL);
    2295 #endif
     2335#endif 
    22962336
    22972337#ifdef EPLAYER4
     
    23052345int playerstop()
    23062346{
     2347
     2348        if(status.actplay != NULL)
     2349        {
     2350                char* fileseek = changefilenameext(status.actplay, ".pts");
     2351                FILE* fbseek = fopen(fileseek, "w");
     2352                if(fbseek != NULL)
     2353                {
     2354                        off64_t pts = playergetpts();
     2355                        printf("++++ pts: %lld\n", pts);
     2356                        fprintf(fbseek,"%lld", pts);
     2357                        fclose(fbseek);
     2358                }
     2359                free(fileseek); fileseek=NULL;
     2360                free(status.actplay); status.actplay=NULL;
     2361        }
     2362         
     2363         
    23072364#ifdef EPLAYER3
    23082365        if(player && player->playback)
     
    25962653void playerseek(float sec)
    25972654{
     2655
     2656printf("++++ playerseek: %f sekunden\n", sec);
     2657
    25982658#ifdef EPLAYER3
    25992659#ifdef EXTEPLAYER3
  • titan/titan/struct.h

    r46307 r46329  
    122122#endif
    123123
    124 #define DRIVER " -   - "
     124#define DRIVER "Sun Nov  6 17:04:33 UTC 2022"
    125125#define OVERSION "1.99"
    126126#define PROGNAME "titan"
    127127#define COPYRIGHT "NIT"
    128128#define CRONTRIBUT "obi, gost"
    129 #define PLUGINVERSION 46306
     129#define PLUGINVERSION 46320
    130130
    131131#define _(x) gettext(x)
     
    17091709        int videodevs;
    17101710        char* streamurl;
     1711        char* actplay;
    17111712} status;
    17121713
Note: See TracChangeset for help on using the changeset viewer.