mp3dec: recover from PCM write errors without crashing

Origin commit data
------------------
Commit: 02efe0918a
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-04-07 (Sun, 07 Apr 2013)
This commit is contained in:
Stefan Seyfried
2013-04-07 17:20:42 +02:00
committed by [CST] Focus
parent 2c9f34cafe
commit 90d15fdd0c

View File

@@ -768,6 +768,8 @@ q * next mad_frame_decode() invocation. (See the comments marked
{ {
fprintf(stderr,"%s: PCM write error in stereo (%s).\n", ProgName, strerror(errno)); fprintf(stderr,"%s: PCM write error in stereo (%s).\n", ProgName, strerror(errno));
Status = WRITE_ERR; Status = WRITE_ERR;
Synth.pcm.length = 0; /* discard buffer */
OutputPtr = OutputBuffer;
break; break;
} }
@@ -835,6 +837,8 @@ q * next mad_frame_decode() invocation. (See the comments marked
{ {
fprintf(stderr,"%s: PCM write error in mono (%s).\n", ProgName, strerror(errno)); fprintf(stderr,"%s: PCM write error in mono (%s).\n", ProgName, strerror(errno));
Status = WRITE_ERR; Status = WRITE_ERR;
Synth.pcm.length = 0; /* discard buffer */
OutputPtr = OutputBuffer;
break; break;
} }