Ticket #2115: 2115.patch
File 2115.patch, 2.3 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/NuppelVideoRecorder.cpp
28 28 #include "recordingprofile.h" 29 29 #include "tv_rec.h" 30 30 #include "tv_play.h" 31 #include "bswap.h" // for WORDS_BIGENDIAN 31 32 32 33 extern "C" { 33 34 #include "vbitext/vbi.h" … … 36 37 #include "videodev_myth.h" 37 38 #include "go7007_myth.h" 38 39 39 #ifdef WORDS_BIGENDIAN40 #include "bswap.h"41 #endif42 43 40 #ifndef MJPIOC_S_PARAMS 44 41 #include "videodev_mjpeg.h" 45 42 #endif … … 3099 3096 lf = fnum; 3100 3097 } 3101 3098 3099 static void bswap_16_buf(short int *buf, int buf_cnt, int audio_channels) 3100 { 3101 for (int i = 0; i < audio_channels * buf_cnt; i++) 3102 buf[i] = bswap_16(buf[i]); 3103 } 3104 3102 3105 void NuppelVideoRecorder::WriteAudio(unsigned char *buf, int fnum, int timecode) 3103 3106 { 3104 3107 struct rtframeheader frameheader; … … 3153 3156 int gaplesssize = 0; 3154 3157 int lameret = 0; 3155 3158 3159 int sample_cnt = audio_buffer_size / audio_bytes_per_sample; 3160 3161 #ifdef WORDS_BIGENDIAN 3162 bswap_16_buf((short int*) buf, sample_cnt, audio_channels); 3163 #endif 3164 3156 3165 if (audio_channels == 2) 3157 3166 { 3158 lameret = lame_encode_buffer_interleaved(gf, (short int *)buf, 3159 audio_buffer_size / 3160 audio_bytes_per_sample, 3161 (unsigned char *)mp3buf, 3162 mp3buf_size); 3167 lameret = lame_encode_buffer_interleaved( 3168 gf, (short int*) buf, sample_cnt, 3169 (unsigned char*) mp3buf, mp3buf_size); 3163 3170 } 3164 3171 else 3165 3172 { 3166 lameret = lame_encode_buffer(gf, (short int *)buf, (short int *)buf, 3167 audio_buffer_size / 3168 audio_bytes_per_sample, 3169 (unsigned char *)mp3buf, 3170 mp3buf_size); 3173 lameret = lame_encode_buffer( 3174 gf, (short int*) buf, (short int*) buf, sample_cnt, 3175 (unsigned char*) mp3buf, mp3buf_size); 3171 3176 } 3172 3177 3173 3178 if (lameret < 0)