summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2009-08-30 16:28:12 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2009-08-30 16:28:12 +0800
commit77ee9b6e87141fbd5993ec5f02ad989329c4c829 (patch)
treec8f793c265ff4b19c604a7c356a121b65bdccbfd
parentb957fe49cf5374e855ba14f95903fe6726285501 (diff)
ppsdemo: url can be specified via command line option now
-rw-r--r--wrapper/ppsdemo-simple.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/wrapper/ppsdemo-simple.c b/wrapper/ppsdemo-simple.c
index bb865e8..df43861 100644
--- a/wrapper/ppsdemo-simple.c
+++ b/wrapper/ppsdemo-simple.c
@@ -149,6 +149,7 @@ int main(int argc, char** argv)
// char outbuf[64 * 1024];
struct timeval block_time;
unsigned long long pos = 0;
+ char* url;
printf("------PPS Vod start...\n");
//again:
@@ -156,6 +157,11 @@ int main(int argc, char** argv)
ret = 0;
filepos = 0;
+ if (argc > 1)
+ url = argv[1];
+ else
+ url = "pps://hwhna3gqea6y5udq2aqa.pps/%D6%D0%B9%FA%CA%BD%C0%EB%BB%E9-01.rmvb";
+
/* initialization */
if (ppsvod_create("ppstream", "demo", "ppsdemo001", pps_event_handler) < 0)
{
@@ -174,13 +180,14 @@ int main(int argc, char** argv)
* In real world, you should get xml file from ppstream.com,
* retrieve urls from that xml file, then pass it to pps_add_task.
*/
- if ((taskindex = ppsvod_add_item("pps://hwhna3gqea6y5udq2aqa.pps/%D6%D0%B9%FA%CA%BD%C0%EB%BB%E9-01.rmvb", 0)) < 0)
+ if ((taskindex = ppsvod_add_item(url, 0)) < 0)
{
printf("------Add task failed!\n");
fclose(fpout);
return -1;
- }
-
+ }
+ printf("--file length: %d\n", ppsvod_get_file_length(taskindex));
+
printf("------Starting task...\n");
if (ppsvod_play_item(taskindex, NULL) < 0)
{