Skip to content

Commit 6e570af

Browse files
committed
aa
1 parent e9386ee commit 6e570af

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

dependency.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,9 @@ void dep_decode_a_video_packet(int p_videoFileIndex) {
622622
LOGI(10, "got a video packet, dump dependency: %d", p_videoFileIndex);
623623
++gVideoCodecCtxDepList[p_videoFileIndex]->dep_video_packet_num;
624624
/*put the video packet into the packet queue, for the decoding thread to access*/
625-
LOGI(10, "put a video packet into queue: %d", p_videoFileIndex);
626-
packet_queue_put(&gVideoPacketQueueList[p_videoFileIndex], &gVideoPacketDepList[p_videoFileIndex]);
625+
//to save memory, don't do it
626+
//LOGI(10, "put a video packet into queue: %d", p_videoFileIndex);
627+
//packet_queue_put(&gVideoPacketQueueList[p_videoFileIndex], &gVideoPacketDepList[p_videoFileIndex]);
627628
/*update the gop information if it's an I-frame
628629
update: for every GOP, we generate a set of dependency files. It has the following advantages:
629630
0. It avoids the overhead, and memory issue caused by opearting on big files
@@ -719,7 +720,7 @@ void dep_decode_a_video_packet(int p_videoFileIndex) {
719720
if (gVideoCodecCtxDepList[p_videoFileIndex]->dump_dependency) {
720721
avcodec_decode_video2_dep(gVideoCodecCtxDepList[p_videoFileIndex], l_videoFrame, &l_numOfDecodedFrames, &gVideoPacketDepList[p_videoFileIndex]);
721722
}
722-
//av_free_packet(&gVideoPacketDepList[p_videoFileIndex]);
723+
av_free_packet(&gVideoPacketDepList[p_videoFileIndex]);
723724
break;
724725
} else {
725726
//it's not a video packet
@@ -975,12 +976,12 @@ void decode_a_video_packet(int p_videoFileIndex, int _roiStH, int _roiStW, int _
975976
/*free the packet*/
976977
av_free_packet(&gVideoPacket);
977978
#ifdef SELECTIVE_DECODING
978-
av_free_packet(&gVideoPacket2);
979+
av_free_packet(&gVideoPacket2);
979980
#endif
980981
break;
981982
} else {
982-
//it's not a video packet
983-
LOGI(10, "it's not a video packet, continue reading! %d != %d", gVideoPacket.stream_index, gVideoStreamIndexList[p_videoFileIndex]);
983+
//it's not a video packet
984+
LOGI(10, "it's not a video packet, continue reading! %d != %d", gVideoPacket.stream_index, gVideoStreamIndexList[p_videoFileIndex]);
984985
av_free_packet(&gVideoPacket);
985986
}
986987
}
@@ -994,7 +995,7 @@ int load_gop_info(FILE* p_gopRecFile, int *p_startF, int *p_endF) {
994995
*p_startF = 0;
995996
*p_endF = 0;
996997
if (fgets(l_gopRecLine, 50, p_gopRecFile) == NULL)
997-
return -1;
998+
return -1;
998999
if ((l_aToken = strtok(l_gopRecLine, ":")) != NULL)
9991000
*p_startF = atoi(l_aToken);
10001001
else
@@ -1004,7 +1005,10 @@ int load_gop_info(FILE* p_gopRecFile, int *p_startF, int *p_endF) {
10041005
else
10051006
return -1;
10061007
LOGI(10, "load gop info ends: %d-%d", *p_startF, *p_endF);
1007-
return 0;
1008+
if (*p_startF > 0 && *p_endF >= *p_startF)
1009+
return 0;
1010+
else
1011+
return -1;
10081012
}
10091013

10101014
/*load the pre computation for a gop and also compute the inter frame dependency for a gop*/

ffplay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This doesn't apply to dcp as it's part of the avcodecContext
4545

4646
#include "dependency.h"
4747

48-
#define NUM_OF_FRAMES_IN_BATCH 800
48+
#define NUM_OF_FRAMES_IN_BATCH 100
4949

5050
/*these two lines are necessary for compilation*/
5151
const char program_name[] = "FFplay";

0 commit comments

Comments
 (0)