+#if LIBAVUTIL_VERSION_INT >= ((53<<16)+(2<<8)+0)
+ avformat_alloc_output_context2( &oc, fmt, format, filename );
+#else
+ oc = avformat_alloc_context( );
+ oc->oformat = fmt;
+ snprintf( oc->filename, sizeof(oc->filename), "%s", filename );
+
+ if ( oc->oformat && oc->oformat->priv_class && !oc->priv_data && oc->oformat->priv_data_size ) {
+ oc->priv_data = av_mallocz( oc->oformat->priv_data_size );
+ if ( oc->priv_data ) {
+ *(const AVClass**)oc->priv_data = oc->oformat->priv_class;
+ av_opt_set_defaults( oc->priv_data );
+ }
+ }
+#endif
+