* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_block.h>
#include <vlc_sout.h>
/* ffmpeg header */
-#ifdef HAVE_FFMPEG_AVFORMAT_H
-# include <ffmpeg/avformat.h>
+#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
+# include <libavformat/avformat.h>
#elif defined(HAVE_LIBAVFORMAT_TREE)
# include <avformat.h>
#endif
//#define AVFORMAT_DEBUG 1
/* Version checking */
-#if defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
static const char *ppsz_mux_options[] = {
"mux", NULL
codec->time_base.den = p_input->p_fmt->video.i_frame_rate;
codec->time_base.num = p_input->p_fmt->video.i_frame_rate_base;
break;
+
+ default:
+ msg_Warn( p_mux, "Unhandled ES category" );
}
codec->bit_rate = p_input->p_fmt->i_bitrate;
I64C(1000000) / p_stream->time_base.num;
/* this is another hack to prevent libavformat from triggering the "non monotone timestamps" check in avformat/utils.c */
- p_stream->cur_dts = AV_NOPTS_VALUE;
+ p_stream->cur_dts = ( p_data->i_dts * p_stream->time_base.den /
+ I64C(1000000) / p_stream->time_base.num ) - 1;
if( av_write_frame( p_sys->oc, &pkt ) < 0 )
{
return 0;
}
-#else /* HAVE_FFMPEG_AVFORMAT_H */
-
-int E_(OpenMux)( vlc_object_t *p_this )
-{
- return VLC_EGENERIC;
-}
-
-void E_(CloseMux)( vlc_object_t *p_this )
-{
-}
-
-#endif /* HAVE_FFMPEG_AVFORMAT_H */
+#endif /* HAVE_LIBAVFORMAT_AVFORMAT_H */