Skip to content

Commit

Permalink
Add code for non-transcoded video streams (#277)
Browse files Browse the repository at this point in the history
* Add code for non-transcoded video streams

* Missed reset_frame_flag!
  • Loading branch information
David Barton authored Nov 22, 2020
1 parent 7e05dc3 commit 78276d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/avio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function retrieve(r::VideoReader{NO_TRANSCODE}) # false=don't transcode

# TODO: set actual dimensions ?
buf_sz = avpicture_get_size(r.format, r.width, r.height)
buf = Array(UInt8, buf_sz)
buf = Array{UInt8}(undef, buf_sz)

retrieve!(r, buf)
end
Expand Down Expand Up @@ -476,6 +476,12 @@ function retrieve!(r::VideoReader{NO_TRANSCODE}, buf::VidArray{T}) where T <: Ei
if !bufsize_check(r, buf)
error("Buffer is the wrong size")
end

unsafe_copyto!(pointer(buf), r.aVideoFrame[1].data[1], sizeof(buf))

reset_frame_flag!(r)

return buf
end

# Utility functions
Expand Down

0 comments on commit 78276d7

Please sign in to comment.