[vlc-devel] commit: Add debug message and quit if channel or rate conversion failed. ( Antoine Cellerier )

git version control git at videolan.org
Sat Aug 23 18:35:13 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Aug 23 18:37:45 2008 +0200| [2f0e1804cc5dbb3a4831333e29204c3176a2b94d] | committer: Antoine Cellerier 

Add debug message and quit if channel or rate conversion failed.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f0e1804cc5dbb3a4831333e29204c3176a2b94d
---

 modules/stream_out/transcode.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c
index a6e7e3b..ba18bde 100644
--- a/modules/stream_out/transcode.c
+++ b/modules/stream_out/transcode.c
@@ -1195,17 +1195,35 @@ static int transcode_audio_new( sout_stream_t *p_stream,
             (fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate) ||
             (fmt_last.i_codec != id->p_encoder->fmt_in.i_codec) )
         {
-            filter_chain_AppendFilter( id->p_f_chain, NULL, NULL, &fmt_last, &id->p_encoder->fmt_in );
+            msg_Dbg( p_stream, "Looking for filter "
+                     "(%4.4s->%4.4s, channels %d->%d, rate %d->%d)",
+                 (char *)&fmt_last.i_codec,
+                 (char *)&id->p_encoder->fmt_in.i_codec,
+                 fmt_last.audio.i_channels,
+                 id->p_encoder->fmt_in.audio.i_channels,
+                 fmt_last.audio.i_rate,
+                 id->p_encoder->fmt_in.audio.i_rate );
+            filter_chain_AppendFilter( id->p_f_chain, NULL, NULL,
+                                       &fmt_last, &id->p_encoder->fmt_in );
             fmt_last = *filter_chain_GetFmtOut( id->p_f_chain );
         }
+        else break;
     }
 
     /* Final checks to see if conversions were successful */
-    if( fmt_last.i_codec != id->p_encoder->fmt_in.i_codec )
+    if( (fmt_last.audio.i_channels !=
+        id->p_encoder->fmt_in.audio.i_channels) ||
+        (fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate) ||
+        (fmt_last.i_codec != id->p_encoder->fmt_in.i_codec) )
     {
-        msg_Err( p_stream, "no audio filter found (%4.4s->%4.4s)",
+        msg_Err( p_stream, "no audio filter found "
+                           "(%4.4s->%4.4s, channels %d->%d, rate %d->%d)",
                  (char *)&fmt_last.i_codec,
-                 (char *)&id->p_encoder->fmt_in.i_codec );
+                 (char *)&id->p_encoder->fmt_in.i_codec,
+                 fmt_last.audio.i_channels,
+                 id->p_encoder->fmt_in.audio.i_channels,
+                 fmt_last.audio.i_rate,
+                 id->p_encoder->fmt_in.audio.i_rate );
         transcode_audio_close( id );
         return VLC_EGENERIC;
     }




More information about the vlc-devel mailing list