Changeset 17015


Ignore:
Timestamp:
07/07/12 19:29:21 (12 years ago)
Author:
nit
Message:

[titan] add playfile support to dvdplayer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/dvdplayer/dvdplay.h

    r16937 r17015  
    44extern struct skin* skin;
    55
    6 void screendvdplay(char* file, int flag)
     6void screendvdplay(char* startfile, int flag)
    77{
    88printf("file1: %s\n",file);
    99        int rcret = 0, playertype = 2, dirrcret = 0;
    10         char* tmpstr = NULL, *startdir = NULL, *tmppolicy = NULL;
     10        char* tmpstr = NULL, *startdir = NULL;
     11        char* file = NULL, *tmppolicy = NULL;
    1112        struct skin* playinfobar = getscreen("playinfobar");
    1213
     
    2627        int playinfobarcount = 0, playinfobarstatus = 0;
    2728printf("file3: %s\n",file);
    28         if(file == NULL)
     29        if(startfile == NULL)
    2930        {
    3031printf("file4: %s\n",file);
     
    3334                free(tmpstr); tmpstr = NULL;
    3435        }
     36        else
     37                file = ostrcat(startfile, NULL, 0, 0);
    3538       
    36         if(dirrcret == 1)
     39        if(startfile == NULL && dirrcret == 1)
    3740        {
    3841                system("umount /media/dvd");
     
    4750                free(tmpstr); tmpstr = NULL;
    4851               
    49                 rcret = servicestop(status.aktservice, 1, 1);
    50                 if(rcret == 1)
     52                if(startfile == NULL)
    5153                {
    52                         free(tmppolicy);
    53                         free(file);
    54                         return;
     54                        rcret = servicestop(status.aktservice, 1, 1);
     55                        if(rcret == 1)
     56                        {
     57                                free(tmppolicy);
     58                                free(file);
     59                                return;
     60                        }
    5561                }
     62                else
     63                        goto playerend;
    5664
    5765                drawscreen(skin, 0, 0);
     
    6573                        writevfd("DVD");
    6674                       
    67                         playstartservice();
    68                         goto playerstart;
     75                        if(startfile == NULL)
     76                        {
     77                                playstartservice();
     78                                goto playerstart;
     79                        }
    6980                }
    7081#endif
     
    100111                                {
    101112                                        playrcstop(playertype, flag);
    102                                         playstartservice();
    103                                         goto playerstart;
     113                                        if(startfile == NULL)
     114                                        {
     115                                                playstartservice();
     116                                                goto playerstart;
     117                                        }
     118                                        else
     119                                                goto playerend;
    104120                                }
    105121
     
    167183                        //the player stops to fast, and a last seek can
    168184                        //produce a segfault
     185playerend:
    169186                        sleep(1);
    170187                        dvdafterend();
     
    173190                        screenplayinfobar(file, 1, playertype, flag);
    174191
    175                         playstartservice();
    176                         goto playerstart;
     192                        if(startfile == NULL)
     193                        {
     194                                playstartservice();
     195                                goto playerstart;
     196                        }
     197                        else
     198                                break;
    177199                }
    178200        }
Note: See TracChangeset for help on using the changeset viewer.