下面的代码是ffserver里面的部分片段; 现在问题是程序执行到这个函数里面就卡住了,求解。 URLContext 为一个包含URLProtocol *prot结构的结构指针; URLProtocol 结构中有一个函数指针url_close如下。 int url_close(URLContext *h) { int ret; printf("url_close\n"); ret = h->prot->url_close(h); av_free(h); printf("url_close ret
struct URLContext {
struct URLProtocol *prot;
int flags;
int is_streamed; /* true if streamed (no seek possible), default = false */
int max_packet_size; /* if non zero, the stream is packetized with this max packet size */
void *priv_data;
char filename[1]; /* specified filename */
};
int url_close(URLContext *h);
typedef struct URLProtocol {
const char *name;
int (*url_open)(URLContext *h, const char *filename, int flags);
int (*url_read)(URLContext *h, unsigned char *buf, int size);
int (*url_write)(URLContext *h, unsigned char *buf, int size);
offset_t (*url_seek)(URLContext *h, offset_t pos, int whence);
int (*url_close)(URLContext *h);
struct URLProtocol *next;
} URLProtocol;
这个url_close函数就是我上面贴的。