diff miscutil/gsmrec-dump.c @ 281:3816ba89a5a0

gsmrec-dump: use libgsmfr2 instead of old libgsm
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Apr 2024 05:09:52 +0000
parents a5ffec18e4cd
children fa8845306e07
line wrap: on
line diff
--- a/miscutil/gsmrec-dump.c	Sun Apr 14 05:00:19 2024 +0000
+++ b/miscutil/gsmrec-dump.c	Sun Apr 14 05:09:52 2024 +0000
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <gsm.h>
+#include "../libgsmfr2/tw_gsmfr.h"
 #include "../libgsmefr/gsm_efr.h"
 #include "../libtest/binreader.h"
 
@@ -14,10 +14,9 @@
 	char **argv;
 {
 	FILE *binf;
-	gsm dummy_state;
 	unsigned frame_index;
 	uint8_t frame[BINFILE_MAX_FRAME];
-	gsm_signal params[76];
+	int16_t params[GSMFR_NUM_PARAMS];
 	int rc, i, j, n;
 
 	if (argc != 2) {
@@ -29,11 +28,6 @@
 		perror(argv[1]);
 		exit(1);
 	}
-	dummy_state = gsm_create();
-	if (!dummy_state) {
-		fprintf(stderr, "gsm_create() failed!\n");
-		exit(1);
-	}
 	for (frame_index = 0; ; frame_index++) {
 		rc = binfile_read_frame(binf, frame);
 		if (rc < 0) {
@@ -63,7 +57,7 @@
 			break;
 		case 0xD0:
 			fputs("FR", stdout);
-			gsm_explode(dummy_state, frame, params);
+			gsmfr_unpack_to_array(frame, params);
 			n = 0;
 			for (i = 0; i < 8; i++)
 				printf(" %d", params[n++]);