[FFmpeg-devel] [PATCH] Don't let error messages overwrite progress information

Michael Karcher ffmpeg
Wed Oct 27 12:09:21 CEST 2010

Am Mittwoch, den 27.10.2010, 11:59 +0200 schrieb Michael Niedermayer:
> > > > For this reason, I suggest adding a new line before printing the
> > > > first line of every warning/error message.
> > > 
> > > this looks like a hack
> > 
> > This is the best I could come up with. Do you have a better proposal?
> > I'm all hears.
> Problem is that we dont want the status line to overwrite something else
> so keep track of the last thing printed and add a \n as needed
What about printing the \r at the beginning of the status message
instead of at the end? For sucessive status outputs, either way works,
but the cursor will be at the end of the status message so it won't be
overwritten if something else is output after it.

Of course this has the downside that the status message will overwrite
whatever was at the beginning of the current line, but I expect that
requiring a newline at the end of each warning/error message is sensible

  Michael Karcher

More information about the ffmpeg-devel mailing list