changeset 20771:1e78e35b6c7b

Change value used to indicate "unknown audio format" from 0 to -1. 0 collided with a valid format value.
author uau
date Wed, 08 Nov 2006 18:31:04 +0000
parents 289050a24c39
children b58788cc1b27
files libaf/af.c libaf/af_format.h mplayer.c
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af.c	Wed Nov 08 17:37:50 2006 +0000
+++ b/libaf/af.c	Wed Nov 08 18:31:04 2006 +0000
@@ -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) || 
--- a/libaf/af_format.h	Wed Nov 08 17:37:50 2006 +0000
+++ b/libaf/af_format.h	Wed Nov 08 18:31:04 2006 +0000
@@ -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);
--- a/mplayer.c	Wed Nov 08 17:37:50 2006 +0000
+++ b/mplayer.c	Wed Nov 08 18:31:04 2006 +0000
@@ -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;