mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
Add -msec option to rescuesdriq
This commit is contained in:
parent
db69c1fb9e
commit
92458b0b5c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<h2>Usage</h2>
|
<h2>Usage</h2>
|
||||||
|
|
||||||
This utility attempts to repair .sdriq files that have their header corrupted or with a pre version 4.2.1 header. Since version 4.2.1 a CRC32 checksum is present and the file will not be played if the check of the header content against the CRC32 fails.
|
This utility attempts to repair .sdriq files, that have their header corrupted, or were created using old versions of SDRangel. Since version 4.2.1 a CRC32 checksum is present and the file will not be played if the check of the header content against the CRC32 fails. In version 6.16.2 the timestamp resolution was increased from seconds to milliseconds since 1970-01-01 00:00:00.000.
|
||||||
|
|
||||||
The header is composed as follows:
|
The header is composed as follows:
|
||||||
|
|
||||||
@ -25,6 +25,8 @@ You can replace values in the header with the following options:
|
|||||||
start time RFC3339 (ex: 2006-01-02T15:04:05Z)
|
start time RFC3339 (ex: 2006-01-02T15:04:05Z)
|
||||||
- -now
|
- -now
|
||||||
use now for start time
|
use now for start time
|
||||||
|
- -msec
|
||||||
|
assume timestamp read from input file is in milliseconds (by default seconds will be assumed)
|
||||||
- -sz uint
|
- -sz uint
|
||||||
Sample size (16 or 24) (default 16)
|
Sample size (16 or 24) (default 16)
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ func main() {
|
|||||||
sampleSize := flag.Uint("sz", 16, "Sample size (16 or 24)")
|
sampleSize := flag.Uint("sz", 16, "Sample size (16 or 24)")
|
||||||
timeStr := flag.String("ts", "", "start time RFC3339 (ex: 2006-01-02T15:04:05Z)")
|
timeStr := flag.String("ts", "", "start time RFC3339 (ex: 2006-01-02T15:04:05Z)")
|
||||||
timeNow := flag.Bool("now", false, "use now for start time")
|
timeNow := flag.Bool("now", false, "use now for start time")
|
||||||
|
assumeMilliseconds := flag.Bool("msec", false, "assume timestamp read from input file is in milliseconds (by default seconds will be assumed)")
|
||||||
blockSize := flag.Uint("bz", 1, "Copy block size in multiple of 4k")
|
blockSize := flag.Uint("bz", 1, "Copy block size in multiple of 4k")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -158,7 +159,9 @@ func main() {
|
|||||||
headerOrigin.StartTimestamp = int64(time.Now().UnixNano() / int64(time.Millisecond))
|
headerOrigin.StartTimestamp = int64(time.Now().UnixNano() / int64(time.Millisecond))
|
||||||
}
|
}
|
||||||
} else if *timeNow {
|
} else if *timeNow {
|
||||||
headerOrigin.StartTimestamp = int64(time.Now().Unix() * 1000)
|
headerOrigin.StartTimestamp = int64(time.Now().UnixNano() / int64(time.Millisecond))
|
||||||
|
} else if !*assumeMilliseconds {
|
||||||
|
headerOrigin.StartTimestamp = headerOrigin.StartTimestamp * (int64(time.Millisecond) / int64(time.Second))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("\nHeader is now")
|
fmt.Println("\nHeader is now")
|
||||||
|
Loading…
Reference in New Issue
Block a user