[MPlayer-dev-eng] [PATCH] af_pan.c: Avoid zero output channels when reinit af pan

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Jun 8 10:00:05 CEST 2007


Hello,
On Fri, Jun 08, 2007 at 12:29:18PM +0800, Zuxy Meng wrote:
[...]
> > Which is not quite what your patch does. It always uses the number of
> > channels supplied on first reinit, which in the future may not be the
> > final number of input channels (and maybe even isn't today?).
> 
> (W/ my patch) If it's been REINITed before then previous settings will
> be retained. If not then pan won't alter the number of audio channels,
> similar behavior as most other audio filters.

That will become a huge pain for supporting AC3 that changes the number
of channels. Luckily enough it is not true, at least the resample
filters update nch on reinit to the new input value.

[...]
> > Huh? The only other thing parsed on the command line is s->level, which
> > is not overwritten on init, so no need to save and restore it.
> > If you mean the bugzilla bug, that bug is somewhere else (filter
> > suboption parser does not treat command line as const string, which is
> > simply wrong).
> 
> Would u come up with a patch for this?

Not really. Half a fix is attached though.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libaf/af.c
===================================================================
--- libaf/af.c	(revision 23505)
+++ libaf/af.c	(working copy)
@@ -116,7 +116,10 @@
   strsep(&cmdline, "=");
 
   // Find filter from name
-  if(NULL == (new->info=af_find(name)))
+  new->info=af_find(name);
+  // restore '=' broken by strsep (wrong, name is needed later)
+  if (cmdline) cmdline[-1] = '=';
+  if (!new->info)
     goto err_out;
 
   /* Make sure that the filter is not already in the list if it is


More information about the MPlayer-dev-eng mailing list