]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mmsh.c
isom: add xd51 hdcam , someone needs to binary search FCP for new isom...
[ffmpeg] / libavformat / mmsh.c
index 10d2a043f1fc202c88d19198fa85c495392b9a6d..358d40fb23bc509f61b97c90cff48918a08c196b 100644 (file)
@@ -66,7 +66,7 @@ static int mmsh_close(URLContext *h)
     MMSHContext *mmsh = (MMSHContext *)h->priv_data;
     MMSContext *mms   = &mmsh->mms;
     if (mms->mms_hd)
-        ffurl_close(mms->mms_hd);
+        ffurl_closep(&mms->mms_hd);
     av_freep(&mms->streams);
     av_freep(&mms->asf_header);
     return 0;
@@ -309,14 +309,16 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
     return 0;
 fail:
     av_freep(&stream_selection);
-    mmsh_close(h);
     av_dlog(NULL, "Connection failed with error %d\n", err);
     return err;
 }
 
 static int mmsh_open(URLContext *h, const char *uri, int flags)
 {
-    return mmsh_open_internal(h, uri, flags, 0, 0);
+    int ret = mmsh_open_internal(h, uri, flags, 0, 0);
+    if (ret < 0)
+        mmsh_close(h);
+    return ret;
 }
 
 static int handle_chunk_type(MMSHContext *mmsh)