diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-14 11:41:48 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-14 11:41:48 +0200 |
commit | 8cb015ad395d13043a7a63a0294550dc4bb3afd8 (patch) | |
tree | 8fec5211547b4b08849eaa71bbfab056fc008693 /plugins/liboggedit/oggedit_flac.c | |
parent | 055ca014541453a3a2e07db6902b16f9406bf530 (diff) | |
parent | caf400178adbcaaace2a258354b7310067726a04 (diff) |
Merge pull request #13 from Lithopsian/flac
Flac/oggflac bitrate calculation improvements
Diffstat (limited to 'plugins/liboggedit/oggedit_flac.c')
-rw-r--r-- | plugins/liboggedit/oggedit_flac.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/liboggedit/oggedit_flac.c b/plugins/liboggedit/oggedit_flac.c index 7c4e5653..9aa89716 100644 --- a/plugins/liboggedit/oggedit_flac.c +++ b/plugins/liboggedit/oggedit_flac.c @@ -36,6 +36,15 @@ #define VCTYPE 0x04 #define LASTBLOCK 0x80 +off_t oggedit_flac_stream_info(DB_FILE *in, const off_t start_offset, const off_t end_offset) +{ + ogg_sync_state oy; + ogg_sync_init(&oy); + const off_t stream_size = codec_stream_size(in, &oy, start_offset, end_offset, FLACNAME); + cleanup(in, NULL, &oy, NULL); + return stream_size; +} + static void clear_header_list(ogg_packet **headers) { if (headers) { @@ -196,7 +205,7 @@ off_t oggedit_write_flac_metadata(DB_FILE *in, const char *fname, const off_t of /* If we have tempfile, copy the remaining pages */ if (*tempname) { - if ((res = copy_remaining_pages(in, out, &oy, flac_serial, pageno)) < OGGEDIT_EOF) + if ((res = copy_remaining_pages(in, out, &oy, flac_serial, pageno)) <= OGGEDIT_EOF) goto cleanup; if (rename(tempname, fname)) { res = OGGEDIT_RENAME_FAILED; |