diff options
author | jstebbins <[email protected]> | 2014-05-29 19:59:57 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-05-29 19:59:57 +0000 |
commit | c50cf79a313ab76473a69f6ed8625afcb1a2c40b (patch) | |
tree | f4f33d97d109481c6e41d7290eb73572d9edc03c /libhb/scan.c | |
parent | 0340cdc16c3cf51f24a2ddfcb40cd8d3b7257e17 (diff) |
libhb: Fix decoding avi with palette
... and probably other formats that use a palette.
The palette is stored in AVPacket side data which we did not read. So
read the side data and stash it in hb_buffer_t so that it can be used
later by the decoder.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6207 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r-- | libhb/scan.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 0e601bb1d..5d8666592 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -554,13 +554,20 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) } else if (data->stream) { - /* we start reading streams at zero rather than 1/11 because - * short streams may have only one sequence header in the entire - * file and we need it to decode any previews. */ - if (!hb_stream_seek(data->stream, (float) i / ( data->preview_count + 1.0 ) ) ) - { - continue; - } + /* we start reading streams at zero rather than 1/11 because + * short streams may have only one sequence header in the entire + * file and we need it to decode any previews. + * + * Also, seeking to position 0 loses the palette of avi files + * so skip initial seek */ + if (i != 0) + { + if (!hb_stream_seek(data->stream, + (float)i / (data->preview_count + 1.0))) + { + continue; + } + } } hb_deep_log( 2, "scan: preview %d", i + 1 ); |