diff options
Diffstat (limited to 'webmdec.cc')
-rw-r--r-- | webmdec.cc | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/webmdec.cc b/webmdec.cc index 36dbd92bf..8f7797038 100644 --- a/webmdec.cc +++ b/webmdec.cc @@ -21,12 +21,12 @@ namespace { void reset(struct WebmInputContext *const webm_ctx) { if (webm_ctx->reader != NULL) { mkvparser::MkvReader *const reader = - reinterpret_cast<mkvparser::MkvReader*>(webm_ctx->reader); + reinterpret_cast<mkvparser::MkvReader *>(webm_ctx->reader); delete reader; } if (webm_ctx->segment != NULL) { mkvparser::Segment *const segment = - reinterpret_cast<mkvparser::Segment*>(webm_ctx->segment); + reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); delete segment; } if (webm_ctx->buffer != NULL) { @@ -46,7 +46,7 @@ void reset(struct WebmInputContext *const webm_ctx) { void get_first_cluster(struct WebmInputContext *const webm_ctx) { mkvparser::Segment *const segment = - reinterpret_cast<mkvparser::Segment*>(webm_ctx->segment); + reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); const mkvparser::Cluster *const cluster = segment->GetFirst(); webm_ctx->cluster = cluster; } @@ -72,7 +72,7 @@ int file_is_webm(struct WebmInputContext *webm_ctx, return 0; } - mkvparser::Segment* segment; + mkvparser::Segment *segment; if (mkvparser::Segment::CreateInstance(reader, pos, segment)) { rewind_and_reset(webm_ctx, vpx_ctx); return 0; @@ -84,11 +84,11 @@ int file_is_webm(struct WebmInputContext *webm_ctx, } const mkvparser::Tracks *const tracks = segment->GetTracks(); - const mkvparser::VideoTrack* video_track = NULL; + const mkvparser::VideoTrack *video_track = NULL; for (unsigned long i = 0; i < tracks->GetTracksCount(); ++i) { - const mkvparser::Track* const track = tracks->GetTrackByIndex(i); + const mkvparser::Track *const track = tracks->GetTrackByIndex(i); if (track->GetType() == mkvparser::Track::kVideo) { - video_track = static_cast<const mkvparser::VideoTrack*>(track); + video_track = static_cast<const mkvparser::VideoTrack *>(track); webm_ctx->video_track_index = track->GetNumber(); break; } @@ -118,8 +118,7 @@ int file_is_webm(struct WebmInputContext *webm_ctx, return 1; } -int webm_read_frame(struct WebmInputContext *webm_ctx, - uint8_t **buffer, +int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer, size_t *buffer_size) { // This check is needed for frame parallel decoding, in which case this // function could be called even after it has reached end of input stream. @@ -127,13 +126,13 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, return 1; } mkvparser::Segment *const segment = - reinterpret_cast<mkvparser::Segment*>(webm_ctx->segment); - const mkvparser::Cluster* cluster = - reinterpret_cast<const mkvparser::Cluster*>(webm_ctx->cluster); + reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); + const mkvparser::Cluster *cluster = + reinterpret_cast<const mkvparser::Cluster *>(webm_ctx->cluster); const mkvparser::Block *block = - reinterpret_cast<const mkvparser::Block*>(webm_ctx->block); + reinterpret_cast<const mkvparser::Block *>(webm_ctx->block); const mkvparser::BlockEntry *block_entry = - reinterpret_cast<const mkvparser::BlockEntry*>(webm_ctx->block_entry); + reinterpret_cast<const mkvparser::BlockEntry *>(webm_ctx->block_entry); bool block_entry_eos = false; do { long status = 0; @@ -175,11 +174,11 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, webm_ctx->block_entry = block_entry; webm_ctx->block = block; - const mkvparser::Block::Frame& frame = + const mkvparser::Block::Frame &frame = block->GetFrame(webm_ctx->block_frame_index); ++webm_ctx->block_frame_index; if (frame.len > static_cast<long>(*buffer_size)) { - delete[] *buffer; + delete[] * buffer; *buffer = new uint8_t[frame.len]; if (*buffer == NULL) { return -1; @@ -191,7 +190,7 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, webm_ctx->is_key_frame = block->IsKey(); mkvparser::MkvReader *const reader = - reinterpret_cast<mkvparser::MkvReader*>(webm_ctx->reader); + reinterpret_cast<mkvparser::MkvReader *>(webm_ctx->reader); return frame.Read(reader, *buffer) ? -1 : 0; } @@ -221,6 +220,4 @@ int webm_guess_framerate(struct WebmInputContext *webm_ctx, return 0; } -void webm_free(struct WebmInputContext *webm_ctx) { - reset(webm_ctx); -} +void webm_free(struct WebmInputContext *webm_ctx) { reset(webm_ctx); } |