From d594fbcd49c8b6c72a78a06922a66383aaa7a823 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 26 Jan 2021 18:29:34 -0500 Subject: [PATCH] Some fixes for unused code (will be used in future) --- src/zm_ffmpeg_input.cpp | 9 +++++++-- src/zm_ffmpeg_input.h | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/zm_ffmpeg_input.cpp b/src/zm_ffmpeg_input.cpp index 84c6ca811..d4ad3a0bc 100644 --- a/src/zm_ffmpeg_input.cpp +++ b/src/zm_ffmpeg_input.cpp @@ -23,9 +23,13 @@ FFmpeg_Input::~FFmpeg_Input() { } } // end ~FFmpeg_Input() +/* Takes streams provided from elsewhere. They might not come from the same source + * but we will treat them as if they are. */ int FFmpeg_Input::Open( const AVStream * video_in_stream, - const AVStream * audio_in_stream + const AVCodecContext * video_in_ctx, + const AVStream * audio_in_stream, + const AVCodecContext * audio_in_ctx ) { video_stream_id = video_in_stream->index; int max_stream_index = video_in_stream->index; @@ -34,7 +38,8 @@ int FFmpeg_Input::Open( max_stream_index = video_in_stream->index > audio_in_stream->index ? video_in_stream->index : audio_in_stream->index; audio_stream_id = audio_in_stream->index; } - streams = new stream[max_stream_index]; + streams = new stream[max_stream_index+1]; + return 1; } int FFmpeg_Input::Open(const char *filepath) { diff --git a/src/zm_ffmpeg_input.h b/src/zm_ffmpeg_input.h index 30af56a32..6c9dc762d 100644 --- a/src/zm_ffmpeg_input.h +++ b/src/zm_ffmpeg_input.h @@ -19,11 +19,15 @@ class FFmpeg_Input { FFmpeg_Input(); ~FFmpeg_Input(); - int Open( const char *filename ); - int Open( const AVStream *, const AVStream * ); + int Open(const char *filename ); + int Open( + const AVStream *, + const AVCodecContext *, + const AVStream *, + const AVCodecContext *); int Close(); - AVFrame *get_frame( int stream_id=-1 ); - AVFrame *get_frame( int stream_id, double at ); + AVFrame *get_frame(int stream_id=-1); + AVFrame *get_frame(int stream_id, double at); int get_video_stream_id() const { return video_stream_id; }