decoder: automatically flush the output buffer after decoder exits

A decoder_flush() invocation was missing in the FLAC plugin, resulting
in casual assertion failures due to a wrong assumption about the last
chunk's audio format.  It's much easier to remove that decoder_flush()
function and make the decoder thread call ob_flush().
This commit is contained in:
Max Kellermann
2008-10-29 17:29:06 +01:00
parent 74c85811af
commit 528b7c3f5e
12 changed files with 3 additions and 30 deletions

View File

@@ -419,8 +419,6 @@ static int aac_stream_decode(struct decoder * mpd_decoder,
break;
}
decoder_flush(mpd_decoder);
faacDecClose(decoder);
if (b.buffer)
free(b.buffer);
@@ -556,8 +554,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
break;
}
decoder_flush(mpd_decoder);
faacDecClose(decoder);
if (b.buffer)
free(b.buffer);

View File

@@ -110,10 +110,7 @@ static int audiofile_decode(struct decoder * decoder, char *path)
bitRate, NULL);
} while (decoder_get_command(decoder) != DECODE_COMMAND_STOP);
decoder_flush(decoder);
afCloseFile(af_fp);
return 0;
}

View File

@@ -314,10 +314,7 @@ static int ffmpeg_decode_internal(BasePtrs *base)
}
} while (decoder_get_command(decoder) != DECODE_COMMAND_STOP);
decoder_flush(decoder);
DEBUG("decoder finish\n");
return 0;
}

View File

@@ -210,8 +210,6 @@ static int mod_decode(struct decoder * decoder, char *path)
total_time, 0, NULL);
}
decoder_flush(decoder);
mod_close(data);
MikMod_Exit();

View File

@@ -1131,9 +1131,7 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
data.mute_frame == MUTEFRAME_SEEK)
decoder_command_finished(decoder);
decoder_flush(decoder);
mp3_data_finish(&data);
return 0;
}

View File

@@ -298,8 +298,6 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK && seeking)
decoder_command_finished(mpd_decoder);
decoder_flush(mpd_decoder);
return 0;
}

View File

@@ -231,8 +231,6 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
replayGainInfo);
}
decoder_flush(mpd_decoder);
freeReplayGainInfo(replayGainInfo);
return 0;

View File

@@ -326,9 +326,6 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
freeReplayGainInfo(replayGainInfo);
ov_clear(&vf);
decoder_flush(decoder);
return 0;
}

View File

@@ -206,8 +206,6 @@ static void wavpack_decode(struct decoder * decoder,
replayGainInfo);
}
} while (samplesgot == samplesreq);
decoder_flush(decoder);
}
static char *wavpack_tag(WavpackContext *wpc, char *key)