Changeset 32149


Ignore:
Timestamp:
01/06/15 22:47:40 (8 years ago)
Author:
obi
Message:

gst add user-agent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/player.h

    r32137 r32149  
    733733                if(size > 0)
    734734                        status.prefillbuffer = 1;
     735
     736                if(ostrstr(file, "|User-Agent=") != NULL)
     737                {
     738                        char* tmpstr = NULL;
     739                        tmpstr = ostrcat(file, NULL, 0, 0);
     740                        tmpstr = string_replace("|User-Agent=", "|", useragent, 1);
     741                        int count1 = 0;
     742                        struct splitstr* ret1 = NULL;
     743                        ret1 = strsplit(tmpstr, "|", &count);
     744                        if(ret1 != NULL && count >= 2)
     745                        {
     746                                printf("[player.h] set user-agent: %s\n",ret1[1].part);
     747                                g_object_set(G_OBJECT(pipeline), "user-agent", ret1[1].part, NULL);
     748                        }
     749                        free(ret1), ret1 = NULL;
     750                        free(tmpstr), tmpstr = NULL;
     751//                      g_object_set(G_OBJECT(pipeline), "user-agent", "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0", NULL);
     752                        stringreplacechar(tmpfile, '|', '\0');
     753                        printf("tmpfile changed: %s\n", tmpfile);
     754                }
    735755
    736756                g_object_set(G_OBJECT(pipeline), "buffer-duration", size * GST_SECOND, NULL);
Note: See TracChangeset for help on using the changeset viewer.