ref: 197a19ad702d5e7472852efcde98feeb07f373e0
parent: bbcaf4115586ac33d5b4350a8b3fd87dbbb6d71f
author: Janne Grunau <janne-vlc@jannau.net>
date: Mon Nov 26 08:08:27 EST 2018
dav1d/cli: start decoding on a sequence header after '--skip'
--- a/tools/dav1d.c
+++ b/tools/dav1d.c
@@ -99,6 +99,23 @@
if (!cli_settings.quiet)
fprintf(stderr, "dav1d %s - by VideoLAN\n", DAV1D_VERSION);
+ // skip frames until a sequence header is found
+ if (cli_settings.skip) {
+ Dav1dSequenceHeader seq;
+ unsigned seq_skip = 0;
+ while (dav1d_parse_sequence_header(&seq, data.data, data.sz)) {
+ if ((res = input_read(in, &data)) < 0) {
+ input_close(in);
+ return res;
+ }
+ seq_skip++;
+ }
+ if (seq_skip && !cli_settings.quiet)
+ fprintf(stderr,
+ "skipped %u packets due to missing sequence header\n",
+ seq_skip);
+ }
+
//getc(stdin);
if (cli_settings.limit != 0 && cli_settings.limit < total)
total = cli_settings.limit;