Skip to content

Commit

Permalink
- file streamer loop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshevach committed Nov 6, 2023
1 parent f42792a commit d752bbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion transcoder/config_v.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"jumpOffsetSec": -60
},
"throttler": {
"maxDataRate": 2.5,
"maxDataRate": 1.5,
"coldSeconds": 0,
"minThrottleWaitMs": 1
},
Expand Down
10 changes: 6 additions & 4 deletions transcoder/debug/file_streamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ void* thread_stream_from_file(void *vargp)

if (realTime && lastDts > 0) {

int64_t timePassed=av_rescale_q(packet.dts-lastDts,standard_timebase,AV_TIME_BASE_Q);
//LOGGER("SENDER",AV_LOG_DEBUG,"XXXX dt=%ld dd=%ld", (av_gettime_relative() - start_time),timePassed);
while ((av_gettime_relative() - start_time) < timePassed) {
int64_t timePassed=av_rescale_q(packet.dts,standard_timebase,AV_TIME_BASE_Q) + start_time,
clockPassed = av_gettime_relative();
LOGGER("SENDER",AV_LOG_DEBUG,"XXXX clockPassed=%ld timePassed=%ld", clockPassed - start_time,timePassed - start_time);
while (clockPassed < timePassed) {

LOGGER0("SENDER",AV_LOG_DEBUG,"XXXX Sleep 10ms");
av_usleep(10*1000);//10ms
clockPassed = av_gettime_relative();
}
}

Expand Down Expand Up @@ -179,7 +181,7 @@ void* thread_stream_from_file(void *vargp)
LOGGER("SENDER",AV_LOG_DEBUG,"sent packet pts=%s dts=%s size=%d",
ts2str(packet.pts,true),
ts2str(packet.dts,true),
packet.dts,packet.size);
packet.size);


av_packet_unref(&packet);
Expand Down

0 comments on commit d752bbe

Please sign in to comment.