[MPlayer-cvslog] r20787 - in trunk: libaf/af.c libaf/af_format.h mplayer.c

uau subversion at mplayerhq.hu
Wed Nov 8 19:31:04 CET 2006


Author: uau
Date: Wed Nov  8 19:31:04 2006
New Revision: 20787

Modified:
   trunk/libaf/af.c
   trunk/libaf/af_format.h
   trunk/mplayer.c

Log:
Change value used to indicate "unknown audio format" from 0 to -1.
0 collided with a valid format value.


Modified: trunk/libaf/af.c
==============================================================================
--- trunk/libaf/af.c	(original)
+++ trunk/libaf/af.c	Wed Nov  8 19:31:04 2006
@@ -443,7 +443,8 @@
     }
     
     // Check output format fix if not OK
-    if(s->output.format && s->last->data->format != s->output.format){
+    if(s->output.format != AF_FORMAT_UNKNOWN &&
+		s->last->data->format != s->output.format){
       if(strcmp(s->last->info->name,"format"))
 	af = af_append(s,s->last,"format");
       else
@@ -460,7 +461,8 @@
     if(AF_OK != af_reinit(s,s->first))
       return -1;
 
-    if (!s->output.format) s->output.format = s->last->data->format;
+    if (s->output.format == AF_FORMAT_UNKNOWN)
+	s->output.format = s->last->data->format;
     if (!s->output.nch) s->output.nch = s->last->data->nch;
     if (!s->output.rate) s->output.rate = s->last->data->rate;
     if((s->last->data->format != s->output.format) || 

Modified: trunk/libaf/af_format.h
==============================================================================
--- trunk/libaf/af_format.h	(original)
+++ trunk/libaf/af_format.h	Wed Nov  8 19:31:04 2006
@@ -84,6 +84,8 @@
 #define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_LE
 #endif
 
+#define AF_FORMAT_UNKNOWN (-1)
+
 extern int af_str2fmt(const char *str);
 extern int af_str2fmt_short(const char *str);
 extern int af_fmt2bits(int format);

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Wed Nov  8 19:31:04 2006
@@ -311,7 +311,7 @@
 
        float force_fps=0;
 static int force_srate=0;
-static int audio_output_format=0;
+static int audio_output_format=-1; // AF_FORMAT_UNKNOWN
        int frame_dropping=0; // option  0=no drop  1= drop vo  2= drop decode
 static int play_n_frames=-1;
 static int play_n_frames_mf=-1;



More information about the MPlayer-cvslog mailing list