@@ -130,16 +130,10 @@ static int tx_st20p_frame_done(void* priv, uint16_t frame_idx,
130
130
frame -> epoch = meta -> epoch ;
131
131
frame -> rtp_timestamp = meta -> rtp_timestamp ;
132
132
133
- if (ctx -> ops .notify_frame_done ) { /* notify app which frame done */
134
- /*
135
- ** Skip notify if ext_frame is used and derive is false (input_fmt != transport_fmt).
136
- ** In this case, the frame done notification is not needed since the notification is
137
- ** already done after convert callback.
138
- ** This is to avoid double notification for the same frame.
139
- */
140
- if (!(ctx -> ops .flags & ST20P_TX_FLAG_EXT_FRAME && !ctx -> derive )) {
141
- ctx -> ops .notify_frame_done (ctx -> ops .priv , frame );
142
- }
133
+ if (ctx -> ops .notify_frame_done &&
134
+ !framebuff -> frame_done_cb_called ) { /* notify app which frame done */
135
+ ctx -> ops .notify_frame_done (ctx -> ops .priv , frame );
136
+ framebuff -> frame_done_cb_called = true;
143
137
}
144
138
145
139
/* notify app can get frame */
@@ -610,6 +604,7 @@ struct st_frame* st20p_tx_get_frame(st20p_tx_handle handle) {
610
604
}
611
605
612
606
framebuff -> stat = ST20P_TX_FRAME_IN_USER ;
607
+ framebuff -> frame_done_cb_called = false;
613
608
/* point to next */
614
609
ctx -> framebuff_producer_idx = tx_st20p_next_idx (ctx , framebuff -> idx );
615
610
mt_pthread_mutex_unlock (& ctx -> lock );
@@ -756,8 +751,10 @@ int st20p_tx_put_ext_frame(st20p_tx_handle handle, struct st_frame* frame,
756
751
if (ctx -> internal_converter ) { /* convert internal */
757
752
ctx -> internal_converter -> convert_func (& framebuff -> src , & framebuff -> dst );
758
753
framebuff -> stat = ST20P_TX_FRAME_CONVERTED ;
759
- if (ctx -> ops .notify_frame_done )
754
+ if (ctx -> ops .notify_frame_done && ! framebuff -> frame_done_cb_called ) {
760
755
ctx -> ops .notify_frame_done (ctx -> ops .priv , & framebuff -> src );
756
+ framebuff -> frame_done_cb_called = true;
757
+ }
761
758
} else {
762
759
framebuff -> stat = ST20P_TX_FRAME_READY ;
763
760
st20_convert_notify_frame_ready (ctx -> convert_impl );
0 commit comments