@@ -787,8 +787,6 @@ segy_file* segy_open( const char* path, const char* mode ) {
787787 ds -> close = fileclose ;
788788 ds -> writable = strstr ( binary_mode , "+" ) || strstr ( binary_mode , "w" );
789789
790- ds -> encoding = SEGY_EBCDIC ;
791-
792790 ds -> minimize_requests_number = true;
793791 ds -> memory_speedup = false;
794792
@@ -848,8 +846,6 @@ segy_datasource* segy_memopen( unsigned char* addr, size_t size ) {
848846
849847 ds -> writable = true;
850848
851- ds -> encoding = SEGY_EBCDIC ;
852-
853849 ds -> minimize_requests_number = false;
854850 ds -> memory_speedup = true;
855851
@@ -981,7 +977,6 @@ int segy_collect_metrics(
981977 if ( err != SEGY_OK ) return err ;
982978 }
983979 ds -> metrics .encoding = encoding ;
984- ds -> encoding = encoding ;
985980
986981 char binheader [SEGY_BINARY_HEADER_SIZE ];
987982 int err = segy_binheader ( ds , binheader );
@@ -2899,7 +2894,7 @@ int segy_read_ext_textheader( segy_datasource* ds, int pos, char *buf) {
28992894 err = ds -> read ( ds , buf , SEGY_TEXT_HEADER_SIZE );
29002895 if ( err != 0 ) return SEGY_DS_READ_ERROR ;
29012896
2902- if ( ds -> encoding == SEGY_EBCDIC ) {
2897+ if ( ds -> metrics . encoding == SEGY_EBCDIC ) {
29032898 encode ( buf , buf , e2a , SEGY_TEXT_HEADER_SIZE );
29042899 }
29052900
@@ -2914,7 +2909,7 @@ int segy_write_textheader( segy_datasource* ds, int pos, const char* buf ) {
29142909
29152910 if ( pos < 0 ) return SEGY_INVALID_ARGS ;
29162911
2917- if ( ds -> encoding == SEGY_EBCDIC ) {
2912+ if ( ds -> metrics . encoding == SEGY_EBCDIC ) {
29182913 encode ( mbuf , buf , a2e , SEGY_TEXT_HEADER_SIZE );
29192914 } else {
29202915 memcpy ( mbuf , buf , SEGY_TEXT_HEADER_SIZE );
0 commit comments