Browse Source

opus & vorbis tweaks

philippe44 5 years ago
parent
commit
3c025c8454
2 changed files with 16 additions and 6 deletions
  1. 8 3
      components/squeezelite/opus.c
  2. 8 3
      components/squeezelite/vorbis.c

+ 8 - 3
components/squeezelite/opus.c

@@ -219,9 +219,14 @@ static decode_state opus_decompress(void) {
 
 	} else if (n == 0) {
 
-		LOG_INFO("end of stream");
-		UNLOCK_O_direct;
-		return DECODE_COMPLETE;
+		if (stream.state <= DISCONNECT) {
+			LOG_INFO("partial decode");
+			UNLOCK_O_direct;
+			UNLOCK_S;
+			return DECODE_COMPLETE;
+		} else {
+			LOG_INFO("no frame decoded");
+        }
 
 	} else if (n == OP_HOLE) {
 

+ 8 - 3
components/squeezelite/vorbis.c

@@ -266,9 +266,14 @@ static decode_state vorbis_decode(void) {
 
 	} else if (n == 0) {
 
-		LOG_INFO("end of stream");
-		UNLOCK_O_direct;
-		return DECODE_COMPLETE;
+		if (stream.state <= DISCONNECT) {
+			LOG_INFO("partial decode");
+			UNLOCK_O_direct;
+			UNLOCK_S;
+			return DECODE_COMPLETE;
+		} else {
+			LOG_INFO("no frame decoded");
+        }
 
 	} else if (n == OV_HOLE) {