Commit 6014f533 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/encoder.c, modules/stream_out/transcode.c: backport of 11318 and 11319.

parent c3922002
...@@ -419,7 +419,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -419,7 +419,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
if ( p_sys->b_trellis ) if ( p_sys->b_trellis )
p_context->flags |= CODEC_FLAG_TRELLIS_QUANT; p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
if ( p_sys->i_qmin == p_sys->i_qmax ) if ( p_sys->i_qmin > 0 && p_sys->i_qmin == p_sys->i_qmax )
p_context->flags |= CODEC_FLAG_QSCALE; p_context->flags |= CODEC_FLAG_QSCALE;
#if LIBAVCODEC_BUILD >= 4702 #if LIBAVCODEC_BUILD >= 4702
......
...@@ -1082,7 +1082,7 @@ static int transcode_audio_new( sout_stream_t *p_stream, ...@@ -1082,7 +1082,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
/* Final checks to see if conversions were successful */ /* Final checks to see if conversions were successful */
if( fmt_last.i_codec != id->p_encoder->fmt_in.i_codec ) if( fmt_last.i_codec != id->p_encoder->fmt_in.i_codec )
{ {
msg_Dbg( p_stream, "no audio filter found (%4.4s->%4.4s)", msg_Err( p_stream, "no audio filter found (%4.4s->%4.4s)",
(char *)&fmt_last.i_codec, (char *)&fmt_last.i_codec,
(char *)&id->p_encoder->fmt_in.i_codec ); (char *)&id->p_encoder->fmt_in.i_codec );
transcode_audio_close( p_stream, id ); transcode_audio_close( p_stream, id );
...@@ -1091,10 +1091,11 @@ static int transcode_audio_new( sout_stream_t *p_stream, ...@@ -1091,10 +1091,11 @@ static int transcode_audio_new( sout_stream_t *p_stream,
if( fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels ) if( fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels )
{ {
msg_Dbg( p_stream, "no audio filter found for mixing from" msg_Err( p_stream, "no audio filter found for mixing from"
" %i to %i channels", fmt_last.audio.i_channels, " %i to %i channels", fmt_last.audio.i_channels,
id->p_encoder->fmt_in.audio.i_channels ); id->p_encoder->fmt_in.audio.i_channels );
#if 0
/* FIXME : this might work, but only if the encoder is restarted */
id->p_encoder->fmt_in.audio.i_channels = fmt_last.audio.i_channels; id->p_encoder->fmt_in.audio.i_channels = fmt_last.audio.i_channels;
id->p_encoder->fmt_out.audio.i_channels = fmt_last.audio.i_channels; id->p_encoder->fmt_out.audio.i_channels = fmt_last.audio.i_channels;
...@@ -1104,15 +1105,25 @@ static int transcode_audio_new( sout_stream_t *p_stream, ...@@ -1104,15 +1105,25 @@ static int transcode_audio_new( sout_stream_t *p_stream,
id->p_encoder->fmt_out.audio.i_physical_channels = id->p_encoder->fmt_out.audio.i_physical_channels =
id->p_encoder->fmt_out.audio.i_original_channels = id->p_encoder->fmt_out.audio.i_original_channels =
fmt_last.audio.i_physical_channels; fmt_last.audio.i_physical_channels;
#else
transcode_audio_close( p_stream, id );
return VLC_EGENERIC;
#endif
} }
if( fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate ) if( fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate )
{ {
msg_Dbg( p_stream, "no audio filter found for resampling from" msg_Err( p_stream, "no audio filter found for resampling from"
" %iHz to %iHz", fmt_last.audio.i_rate, " %iHz to %iHz", fmt_last.audio.i_rate,
id->p_encoder->fmt_in.audio.i_rate ); id->p_encoder->fmt_in.audio.i_rate );
#if 0
/* FIXME : this might work, but only if the encoder is restarted */
id->p_encoder->fmt_in.audio.i_rate = fmt_last.audio.i_rate; id->p_encoder->fmt_in.audio.i_rate = fmt_last.audio.i_rate;
id->p_encoder->fmt_out.audio.i_rate = fmt_last.audio.i_rate; id->p_encoder->fmt_out.audio.i_rate = fmt_last.audio.i_rate;
#else
transcode_audio_close( p_stream, id );
return VLC_EGENERIC;
#endif
} }
/* FIXME: Hack for mp3 transcoding support */ /* FIXME: Hack for mp3 transcoding support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment