Mercurial > libavformat.hg
comparison avio.c @ 19:81e87c8de3dc libavformat
added url_get_filename()
author | bellard |
---|---|
date | Sat, 11 Jan 2003 04:59:17 +0000 |
parents | 05318cf2e886 |
children | 22e4d9d88e25 |
comparison
equal
deleted
inserted
replaced
18:01e35bb2689a | 19:81e87c8de3dc |
---|---|
59 up = up->next; | 59 up = up->next; |
60 } | 60 } |
61 err = -ENOENT; | 61 err = -ENOENT; |
62 goto fail; | 62 goto fail; |
63 found: | 63 found: |
64 uc = av_malloc(sizeof(URLContext)); | 64 uc = av_malloc(sizeof(URLContext) + strlen(filename)); |
65 if (!uc) { | 65 if (!uc) { |
66 err = -ENOMEM; | 66 err = -ENOMEM; |
67 goto fail; | 67 goto fail; |
68 } | 68 } |
69 strcpy(uc->filename, filename); | |
69 uc->prot = up; | 70 uc->prot = up; |
70 uc->flags = flags; | 71 uc->flags = flags; |
71 uc->is_streamed = 0; /* default = not streamed */ | 72 uc->is_streamed = 0; /* default = not streamed */ |
72 uc->max_packet_size = 0; /* default: stream file */ | 73 uc->max_packet_size = 0; /* default: stream file */ |
73 err = up->url_open(uc, filename, flags); | 74 err = up->url_open(uc, filename, flags); |
152 */ | 153 */ |
153 int url_get_max_packet_size(URLContext *h) | 154 int url_get_max_packet_size(URLContext *h) |
154 { | 155 { |
155 return h->max_packet_size; | 156 return h->max_packet_size; |
156 } | 157 } |
158 | |
159 void url_get_filename(URLContext *h, char *buf, int buf_size) | |
160 { | |
161 pstrcpy(buf, buf_size, h->filename); | |
162 } |