]> git.sesse.net Git - vlc/blobdiff - modules/codec/ffmpeg/mux.c
* don't add an 'empty folder' if the user hit cancel when asked to enter a name for it
[vlc] / modules / codec / ffmpeg / mux.c
index ea0c5f7abca654960214e084beedbd4e43bba850..9b7d5623a265e6a4bea75025f64a032ff191fa06 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * mux.c: muxer using ffmpeg (libavformat).
  *****************************************************************************
- * Copyright (C) 2006 VideoLAN
+ * Copyright (C) 2006 the VideoLAN team
  * $Id: demux.c 8444 2004-08-17 08:21:07Z gbazin $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
 #include <stdlib.h>                                      /* malloc(), free() */
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
+#include <vlc_block.h>
+#include <vlc_sout.h>
 
 /* ffmpeg header */
 #ifdef HAVE_FFMPEG_AVFORMAT_H
 #   include <ffmpeg/avformat.h>
-#else
+#elif defined(HAVE_LIBAVFORMAT_TREE)
 #   include <avformat.h>
 #endif
 
@@ -42,7 +42,7 @@
 //#define AVFORMAT_DEBUG 1
 
 /* Version checking */
-#if (LIBAVFORMAT_BUILD >= 4687) && (defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE))
+#if defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
 
 /*****************************************************************************
  * mux_sys_t: mux descriptor
@@ -79,6 +79,7 @@ static offset_t IOSeek( void *opaque, offset_t offset, int whence );
  *****************************************************************************/
 int E_(OpenMux)( vlc_object_t *p_this )
 {
+    AVOutputFormat *file_oformat; 
     sout_mux_t *p_mux = (sout_mux_t*)p_this;
     sout_mux_sys_t *p_sys;
     AVFormatParameters params, *ap = &params;
@@ -87,7 +88,7 @@ int E_(OpenMux)( vlc_object_t *p_this )
     av_register_all();
 
     /* Find the requested muxer */
-    AVOutputFormat *file_oformat =
+    file_oformat =
         guess_format(NULL, p_mux->p_access->psz_name, NULL);
     if (!file_oformat)
     {
@@ -300,7 +301,9 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
     block_t *p_data = block_FifoGet( p_input->p_fifo );
     int i_stream = *((int *)p_input->p_sys);
     AVStream *p_stream = p_sys->oc->streams[i_stream];
-    AVPacket pkt = {0};
+    AVPacket pkt;
+
+    memset( &pkt, 0, sizeof(AVPacket) );
 
     av_init_packet(&pkt);
     pkt.data = p_data->p_buffer;
@@ -440,7 +443,7 @@ static offset_t IOSeek( void *opaque, offset_t offset, int whence )
     return 0;
 }
 
-#else /* LIBAVFORMAT_BUILD >= 4687 */
+#else /* HAVE_FFMPEG_AVFORMAT_H */
 
 int E_(OpenMux)( vlc_object_t *p_this )
 {
@@ -451,4 +454,4 @@ void E_(CloseMux)( vlc_object_t *p_this )
 {
 }
 
-#endif /* LIBAVFORMAT_BUILD >= 4687 */
+#endif /* HAVE_FFMPEG_AVFORMAT_H */