소스 검색

better mad sync

Philippe G 4 년 전
부모
커밋
7f671909bb
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      components/squeezelite/mad.c

+ 2 - 0
components/squeezelite/mad.c

@@ -243,6 +243,8 @@ static decode_state mad_decode(void) {
 		MAD(m, synth_frame, &m->synth, &m->frame);
 
 		if (decode.new_stream) {
+			// seems that mad can use some help in term of sync detection
+			if (m->stream.next_frame[0] != 0xff || (m->stream.next_frame[1] & 0xf0) != 0xf0) continue;
 			LOCK_O;
 			LOG_INFO("setting track_start");
 			output.next_sample_rate = decode_newstream(m->synth.pcm.samplerate, output.supported_rates);