From f8ca175a583e0079c77eeb5135d03d4586424dc4 Mon Sep 17 00:00:00 2001 From: Consti10 Date: Tue, 30 Apr 2024 12:18:11 +0200 Subject: [PATCH] improve insert eof --- .../linux/apps/hello_pi/hello_video/fpv_video0.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/host_applications/linux/apps/hello_pi/hello_video/fpv_video0.cpp b/host_applications/linux/apps/hello_pi/hello_video/fpv_video0.cpp index d041dbf97..2a33c80e8 100644 --- a/host_applications/linux/apps/hello_pi/hello_video/fpv_video0.cpp +++ b/host_applications/linux/apps/hello_pi/hello_video/fpv_video0.cpp @@ -109,7 +109,8 @@ void configure_x20(OMX_BUFFERHEADERTYPE *buf){ uint64_t first_frame_ms=0; bool air_unit_discovery_finished= false; -static int video_decode_test(FILE* in,bool insert_eof) { +bool insert_eof= false; +static int video_decode_test(FILE* in) { OMX_VIDEO_PARAM_PORTFORMATTYPE format; OMX_TIME_CONFIG_CLOCKSTATETYPE cstate; @@ -285,6 +286,7 @@ static int video_decode_test(FILE* in,bool insert_eof) { // We have an x20 configure_x20(buf); air_unit_discovery_finished= true; + insert_eof= true; continue; }else if(x20_check==2){ // We have no x20 (definitely) @@ -401,8 +403,8 @@ int main(int argc, char **argv) { if((in = fopen(argv[1], "rb")) == NULL){ return -2; } - bool insert_eof = argc >=3; - int ret=video_decode_test(in,insert_eof); + insert_eof = argc >=3; + int ret=video_decode_test(in); if(in){ fclose(in); }