]> git.sesse.net Git - vlc/commitdiff
* Fix ffmpeg muxer. (flv muxing now works with ./vlc --sout "#transcode{vcodec...
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Feb 2007 19:45:32 +0000 (19:45 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Feb 2007 19:45:32 +0000 (19:45 +0000)
 * Remove a bunch of trailing white spaces.

modules/codec/ffmpeg/demux.c
modules/codec/ffmpeg/encoder.c
modules/codec/ffmpeg/mux.c

index 6b9e818e2cb1c411b0cff6eb4e0b834774b56bf9..3932ae811ad1d553470f6ffb3b9909e196b86567 100644 (file)
@@ -314,7 +314,7 @@ static int Demux( demux_t *p_demux )
 
     if( pkt.dts > 0  &&
         ( pkt.stream_index == p_sys->i_pcr_tk || p_sys->i_pcr_tk < 0 ) )
-    {    
+    {
         p_sys->i_pcr_tk = pkt.stream_index;
         p_sys->i_pcr = p_frame->i_dts;
 
index 29ff474f4221c04acdab3cc5f43fa7b2d6ea72c6..6b5ffe52584662b3bd8dea7338ea45b0bcd146be 100644 (file)
@@ -215,7 +215,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
     if( p_enc->fmt_out.i_cat == VIDEO_ES && i_cat != VIDEO_ES )
     {
         msg_Err( p_enc, "\"%s\" is not a video encoder", psz_namecodec );
-        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"), 
+        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"),
                         _("\"%s\" is no video encoder."), psz_namecodec );
         return VLC_EGENERIC;
     }
@@ -223,7 +223,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
     if( p_enc->fmt_out.i_cat == AUDIO_ES && i_cat != AUDIO_ES )
     {
         msg_Err( p_enc, "\"%s\" is not an audio encoder", psz_namecodec );
-        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"), 
+        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"),
                         _("\"%s\" is no audio encoder."), psz_namecodec );
         return VLC_EGENERIC;
     }
@@ -235,7 +235,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
     if( !p_codec )
     {
         msg_Err( p_enc, "cannot find encoder %s", psz_namecodec );
-        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"), 
+        intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"),
                         _("VLC could not find encoder \"%s\"."), psz_namecodec );
         return VLC_EGENERIC;
     }
@@ -407,7 +407,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
         p_context->max_b_frames =
             __MAX( __MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES ), 0 );
         p_context->b_frame_strategy = 0;
-        if( !p_context->max_b_frames  && 
+        if( !p_context->max_b_frames  &&
             (  p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v') ||
                p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '1', 'v') ) )
             p_context->flags |= CODEC_FLAG_LOW_DELAY;
@@ -589,7 +589,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
             {
                 vlc_mutex_unlock( lockval.p_address );
                 msg_Err( p_enc, "cannot open encoder" );
-                intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"), 
+                intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"),
                                 _("VLC could not open the encoder.") );
                 free( p_sys );
                 return VLC_EGENERIC;
@@ -598,7 +598,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
         else
         {
             msg_Err( p_enc, "cannot open encoder" );
-            intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"), 
+            intf_UserFatal( p_enc, VLC_FALSE, _("Streaming / Transcoding failed"),
                             _("VLC could not open the encoder.") );
             free( p_sys );
             return VLC_EGENERIC;
@@ -784,7 +784,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
                 {
                     if ( p_sys->b_trellis )
                         p_sys->p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
-                        
+
                     p_sys->p_context->noise_reduction =
                         p_sys->i_noise_reduction;
                 }
index 29704d8d8d511912e5f2a9ccb8da9ba9b88fe318..3b9cdd4fdcda8772cf38279f245d35ee12cc290c 100644 (file)
@@ -248,7 +248,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     }
 
     codec->bit_rate = p_input->p_fmt->i_bitrate;
-    codec->codec_tag = p_input->p_fmt->i_codec;
+    /* This is a hack */
+    if( i_codec_id == CODEC_ID_MP2 )
+        i_codec_id = CODEC_ID_MP3;
+    codec->codec_tag = av_codec_get_tag( p_sys->oc->oformat->codec_tag, i_codec_id );//p_input->p_fmt->i_codec;
     codec->codec_id = i_codec_id;
 
     if( p_input->p_fmt->i_extra )
@@ -338,6 +341,9 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
         pkt.dts = p_data->i_dts * p_stream->time_base.den /
             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;
+
     if( av_write_frame( p_sys->oc, &pkt ) < 0 )
     {
         msg_Err( p_mux, "could not write frame (pts: "I64Fd", dts: "I64Fd") "