comparison SDL_sound.c @ 311:d62c05322a3e

Logic fixes from Torbj�rn.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 24 Apr 2002 20:46:39 +0000
parents c97be6e1bd27
children 31cc49d7d0ce
comparison
equal deleted inserted replaced
310:9e21cb0d3ae7 311:d62c05322a3e
778 assert(sample->buffer_size > 0); 778 assert(sample->buffer_size > 0);
779 assert(internal->buffer != NULL); 779 assert(internal->buffer != NULL);
780 assert(internal->buffer_size > 0); 780 assert(internal->buffer_size > 0);
781 781
782 /* reset EAGAIN. Decoder can flip it back on if it needs to. */ 782 /* reset EAGAIN. Decoder can flip it back on if it needs to. */
783 sample->flags &= !SOUND_SAMPLEFLAG_EAGAIN; 783 sample->flags &= ~SOUND_SAMPLEFLAG_EAGAIN;
784 retval = internal->funcs->read(sample); 784 retval = internal->funcs->read(sample);
785 785
786 if (retval > 0 && internal->sdlcvt.needed) 786 if (retval > 0 && internal->sdlcvt.needed)
787 { 787 {
788 internal->sdlcvt.len = retval; 788 internal->sdlcvt.len = retval;
851 { 851 {
852 sample->flags |= SOUND_SAMPLEFLAG_ERROR; 852 sample->flags |= SOUND_SAMPLEFLAG_ERROR;
853 return(0); 853 return(0);
854 } /* if */ 854 } /* if */
855 855
856 sample->flags &= !SOUND_SAMPLEFLAG_EAGAIN; 856 sample->flags &= ~SOUND_SAMPLEFLAG_EAGAIN;
857 sample->flags &= !SOUND_SAMPLEFLAG_ERROR; 857 sample->flags &= ~SOUND_SAMPLEFLAG_ERROR;
858 sample->flags &= !SOUND_SAMPLEFLAG_EOF; 858 sample->flags &= ~SOUND_SAMPLEFLAG_EOF;
859 859
860 return(1); 860 return(1);
861 } /* Sound_Rewind */ 861 } /* Sound_Rewind */
862 862
863 863
870 BAIL_MACRO(ERR_CANNOT_SEEK, 0); 870 BAIL_MACRO(ERR_CANNOT_SEEK, 0);
871 871
872 internal = (Sound_SampleInternal *) sample->opaque; 872 internal = (Sound_SampleInternal *) sample->opaque;
873 BAIL_IF_MACRO(!internal->funcs->seek(sample, ms), NULL, 0); 873 BAIL_IF_MACRO(!internal->funcs->seek(sample, ms), NULL, 0);
874 874
875 sample->flags &= !SOUND_SAMPLEFLAG_EAGAIN; 875 sample->flags &= ~SOUND_SAMPLEFLAG_EAGAIN;
876 sample->flags &= !SOUND_SAMPLEFLAG_ERROR; 876 sample->flags &= ~SOUND_SAMPLEFLAG_ERROR;
877 sample->flags &= !SOUND_SAMPLEFLAG_EOF; 877 sample->flags &= ~SOUND_SAMPLEFLAG_EOF;
878 878
879 return(1); 879 return(1);
880 } /* Sound_Rewind */ 880 } /* Sound_Rewind */
881 881
882 882