From d7f45f58556ee009cde912ff9988586e35c8fe83 Mon Sep 17 00:00:00 2001 From: shatty Date: Fri, 30 Jan 2004 09:21:22 +0000 Subject: [PATCH] NegotiateOutputFormat can not error in any situation -- really git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6431 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/plugins/speex/speexCodecPlugin.cpp | 7 ++----- src/add-ons/media/plugins/vorbis/vorbisCodecPlugin.cpp | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/add-ons/media/plugins/speex/speexCodecPlugin.cpp b/src/add-ons/media/plugins/speex/speexCodecPlugin.cpp index f20a4b4244..fdc91a2ade 100644 --- a/src/add-ons/media/plugins/speex/speexCodecPlugin.cpp +++ b/src/add-ons/media/plugins/speex/speexCodecPlugin.cpp @@ -203,6 +203,8 @@ SpeexDecoder::NegotiateOutputFormat(media_format *ioDecodedFormat) // that will be output; this can be different if you // specified any wildcards. // + // Be R5 behavior seems to be that we can never fail. If we + // don't support the requested format, just return one we do. media_format format = speex_decoded_media_format(); format.u.raw_audio.frame_rate = (float)fHeader->rate; format.u.raw_audio.channel_count = fHeader->nb_channels; @@ -216,12 +218,7 @@ SpeexDecoder::NegotiateOutputFormat(media_format *ioDecodedFormat) buffer_size = ((buffer_size - 1) / output_length + 1) * output_length; format.u.raw_audio.buffer_size = buffer_size; if (!format_is_compatible(format,*ioDecodedFormat)) { -#ifdef NegotiateOutputFormat_AS_BEBOOK_SPEC - return B_ERROR; -#else - // Be R5 behavior: never fail (?) => nuke the input format *ioDecodedFormat = format; -#endif } ioDecodedFormat->SpecializeTo(&format); // setup output variables diff --git a/src/add-ons/media/plugins/vorbis/vorbisCodecPlugin.cpp b/src/add-ons/media/plugins/vorbis/vorbisCodecPlugin.cpp index 5df9df421d..a03adb5c78 100644 --- a/src/add-ons/media/plugins/vorbis/vorbisCodecPlugin.cpp +++ b/src/add-ons/media/plugins/vorbis/vorbisCodecPlugin.cpp @@ -125,6 +125,8 @@ VorbisDecoder::NegotiateOutputFormat(media_format *ioDecodedFormat) // that will be output; this can be different if you // specified any wildcards. // + // Be R5 behavior seems to be that we can never fail. If we + // don't support the requested format, just return one we do. media_format format = vorbis_decoded_media_format(); format.u.raw_audio.frame_rate = (float)fInfo.rate; format.u.raw_audio.channel_count = fInfo.channels; @@ -133,12 +135,7 @@ VorbisDecoder::NegotiateOutputFormat(media_format *ioDecodedFormat) format.u.raw_audio.buffer_size = AudioBufferSize(&format.u.raw_audio); } if (!format_is_compatible(format,*ioDecodedFormat)) { -#ifdef NegotiateOutputFormat_AS_BEBOOK_SPEC - return B_ERROR; -#else - // Be R5 behavior: never fail (?) => nuke the input format *ioDecodedFormat = format; -#endif } ioDecodedFormat->SpecializeTo(&format); // setup output variables