Changeset 2091:d988fc5c90d8 in roaraudio
- Timestamp:
- 07/20/09 18:26:45 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/streams.c
r2089 r2091 827 827 size_t inlen_got; 828 828 void * indata = NULL; 829 size_t buflen; 830 void * bufdata = NULL; 831 struct roar_buffer * bufbuf = NULL; 829 832 int is_the_same = 0; 830 833 struct roar_audio_info * stream_info; … … 841 844 inlen = ROAR_OUTPUT_CALC_OUTBUFSIZE(stream_info); 842 845 846 buflen = ROAR_OUTPUT_CALC_OUTBUFSIZE_MAX(info, stream_info); 847 843 848 if ( inlen == 0 ) { 844 849 ROAR_WARN("streams_fill_mixbuffer2(id=%i, info=%p{...}): inlen == 0, this should not happen!", id, info); … … 861 866 ROAR_DBG("streams_fill_mixbuffer2(*): is_the_same=%i", is_the_same); 862 867 863 if ( inlen > outlen ) { 868 if ( !is_the_same && buflen > outlen ) { 869 /* 864 870 // this is not supported at the moment 865 871 memset(outdata, 0, outlen); 866 872 return -1; 873 */ 874 875 if ( roar_buffer_new(&bufbuf, buflen) == -1 ) 876 return -1; 877 878 if ( roar_buffer_get_data(bufbuf, &bufdata) == -1 ) 879 return -1; 867 880 } else { 868 indata = outdata; 881 indata = outdata; 882 bufdata = outdata; 869 883 } 870 884 … … 896 910 } else { 897 911 if ( roar_conv(outdata, indata, (8*inlen_got*info->rate)/(stream_info->rate * stream_info->bits), stream_info, info) == -1 ) { 912 if ( bufbuf != NULL ) 913 roar_buffer_free(bufbuf); 898 914 return -1; 899 915 } 900 916 901 917 // memset(outdata, 0, outlen); 918 } 919 920 if ( bufbuf != NULL ) { 921 memcpy(outdata, bufdata, outlen); 922 roar_buffer_free(bufbuf); 902 923 } 903 924
Note: See TracChangeset
for help on using the changeset viewer.