]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix segault
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 May 2010 21:39:39 +0000 (23:39 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 May 2010 21:41:45 +0000 (23:41 +0200)
libavformat/aviobuf.c

index 8493e553276ac21925034d062a098917effd5997..865a76ad1980a5ad52f337a54f28a78abd0320e5 100644 (file)
@@ -589,8 +589,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
     } else {
         buffer_size = IO_BUFFER_SIZE;
     }
-    (*s)->o_direct_flag = !!(h->flags & URL_DIRECT);
-    if ((*s)->o_direct_flag) {
+    if (h->flags & URL_DIRECT) {
        buffer_size = 2*buffer_size+BLOCK_SIZE;
        buffer = memalign(sysconf(_SC_PAGESIZE), buffer_size);
        ;
@@ -615,6 +614,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
     }
     (*s)->is_streamed = h->is_streamed;
     (*s)->max_packet_size = max_packet_size;
+    (*s)->o_direct_flag = !!(h->flags & URL_DIRECT);
     if(h->prot) {
         (*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause;
         (*s)->read_seek  = (int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek;