summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-10 17:19:18 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-10 17:19:18 +0000
commit13b723459b577f9b1977a84ffa82344505a59b6f (patch)
treeaf1cd10369d9391b228a1657205ec7b8e0e922a5 /libmpdemux
parent7420952caf36b0d86e850160dd8689158df6de7c (diff)
downloadmpv-13b723459b577f9b1977a84ffa82344505a59b6f.tar.bz2
mpv-13b723459b577f9b1977a84ffa82344505a59b6f.tar.xz
Replace a really ugly hack by a clean but not thread safe solution.
(no threads so no problem anyway ...) This fixes the segfault with lavf muxing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26722 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/muxer_lavf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmpdemux/muxer_lavf.c b/libmpdemux/muxer_lavf.c
index f1cd641d13..b14a2758fb 100644
--- a/libmpdemux/muxer_lavf.c
+++ b/libmpdemux/muxer_lavf.c
@@ -61,8 +61,14 @@ m_option_t lavfopts_conf[] = {
{NULL, NULL, 0, 0, 0, 0, NULL}
};
+static muxer_t *priv_data; // This should be transmitted to mp_open() through the filename
+ // when thread saftey is needed but mplayer == no threads and
+ // especially not multiple muxers being inited at once so theres
+ // no point in the extra complexity, a static is simpler.
+
static int mp_open(URLContext *h, const char *filename, int flags)
{
+ h->priv_data= priv_data;
return 0;
}
@@ -388,14 +394,13 @@ int muxer_init_muxer_lavf(muxer_t *muxer)
av_strlcpy(priv->oc->comment , info_comment, sizeof(priv->oc->comment ));
register_protocol(&mp_protocol);
+ priv_data= muxer;
if(url_fopen(&priv->oc->pb, mp_filename, URL_WRONLY))
{
mp_msg(MSGT_MUXER, MSGL_FATAL, "Could not open outfile\n");
goto fail;
}
- ((URLContext*)(priv->oc->pb->opaque))->priv_data= muxer;
-
muxer->priv = (void *) priv;
muxer->cont_new_stream = &lavf_new_stream;
muxer->cont_write_chunk = &write_chunk;