Skip to content

Commit

Permalink
- fix logs
Browse files Browse the repository at this point in the history
- fix acks in testing
  • Loading branch information
igorshevach committed Sep 18, 2024
1 parent 200f8c5 commit a798d11
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
8 changes: 4 additions & 4 deletions transcoder/ackHandler/ackHandlerInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
try {
am.addIn(*desc);
} catch(const std::exception &e) {
LOGGER(LoggingCategory,AV_LOG_ERROR," %s audio map. ack_map_add_input %d %lld failed due to %s",
LOGGER(LoggingCategory,AV_LOG_ERROR," %s map. ack_map_add_input %lld %lld failed due to %s",
am.m_name.c_str(),desc->id, desc->pts,e.what());
}
}
Expand All @@ -20,7 +20,7 @@
try {
am.addFiltered(*desc);
} catch(const std::exception &e) {
LOGGER(LoggingCategory,AV_LOG_ERROR," %s audio map. ack_map_add_filtered %d %lld failed due to %s",
LOGGER(LoggingCategory,AV_LOG_ERROR," %s map. ack_map_add_filtered %lld %lld failed due to %s",
am.m_name.c_str(),desc->id, desc->pts,e.what());
}
}
Expand All @@ -33,7 +33,7 @@
try {
am.addOut(*desc);
} catch(const std::exception &e) {
LOGGER(LoggingCategory,AV_LOG_ERROR," %s audio map. ack_map_add_output %d %lld failed due to %s",
LOGGER(LoggingCategory,AV_LOG_ERROR," %s map. ack_map_add_output %lld %lld failed due to %s",
am.m_name.c_str(),desc->id, desc->pts,e.what());
}
}
Expand All @@ -48,7 +48,7 @@
am.map(ack,*ao);
return;
} catch(const std::exception &e) {
LOGGER(LoggingCategory,AV_LOG_ERROR," %s audio map. ack_map_ack %lld failed due to %s",
LOGGER(LoggingCategory,AV_LOG_ERROR," %s map. ack_map_ack %lld failed due to %s",
am.m_name.c_str(),ack, e.what());
}
}
Expand Down
9 changes: 7 additions & 2 deletions transcoder/receiver_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ int clientLoop(receiver_server_t *server,receiver_server_session_t *session,tran
if(!autoAckMode) {
transcode_session_get_ack_frame_id(transcode_session,&current_position);
// TODO: we cheat here, received_frame_id may have not been persisted yet
// so we should make sure all of the frames are consumed ny upstream
// so we should ensure all of the frames up to received_frame_id
// inclusively, are consumed by upstream
current_position.frame_id = current_position.transcoded_frame_id = received_frame_id;
LOGGER(CATEGORY_RECEIVER,AV_LOG_INFO,"[%s] sending ack for packet # : %lld",session->stream_name,current_position.frame_id);
LOGGER(CATEGORY_RECEIVER,AV_LOG_INFO,"[%s] sending ack for frame position: %lld, %lld, %lld",
session->stream_name,
current_position.frame_id,
current_position.transcoded_frame_id,
current_position.offset);
_S(KMP_send_ack(&session->kmpClient,&current_position));
}
break;
Expand Down
18 changes: 10 additions & 8 deletions transcoder/transcode/transcode_session_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,16 @@ int transcode_session_output_send_output_packet(transcode_session_output_t *pOut
}
av_write_frame(pOutput->oc, NULL);

ack_desc_t desc = {0};
if( (ret = get_packet_frame_id(cpPacket,&desc.id)) >= 0) {
if(pOutput->acker.ctx){
pOutput->acker.map(&pOutput->acker,desc.id,&desc);
}
pOutput->lastMappedAck = desc.id;
pOutput->lastAck=desc.id;
pOutput->lastOffset=desc.offset;
if(cpPacket->flags & AV_PKT_FLAG_KEY) {
ack_desc_t desc = {0};
if( (ret = get_packet_frame_id(cpPacket,&desc.id)) >= 0) {
if(pOutput->acker.ctx){
pOutput->acker.map(&pOutput->acker,desc.id,&desc);
}
pOutput->lastMappedAck = desc.id;
pOutput->lastAck=desc.id;
pOutput->lastOffset=desc.offset;
}
}

av_packet_free(&cpPacket);
Expand Down

0 comments on commit a798d11

Please sign in to comment.