diff options
Diffstat (limited to 'src/liana/handlers/codec_client.c')
| -rw-r--r-- | src/liana/handlers/codec_client.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/liana/handlers/codec_client.c b/src/liana/handlers/codec_client.c index 5c8e94d..f7bde35 100644 --- a/src/liana/handlers/codec_client.c +++ b/src/liana/handlers/codec_client.c @@ -92,7 +92,9 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc case CAMU_NORMAL: { if (codec->dec) { if (packet->opaque) { - success = push_packet(codec, (struct nn_buffer *)packet->opaque); + struct nn_buffer *buffer = (struct nn_buffer *)packet->opaque; + success = push_packet(codec, buffer); + packet->opaque = NULL; } else { struct nn_buffer buffer; nn_packet_read_buffer(packet, &buffer); @@ -126,10 +128,10 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc struct camu_codec_stream *stream = codec->handler.stream; AVRational time_base = stream->av.stream->time_base; pkt->pts += av_rescale_q(stream->duration, AV_TIME_BASE_Q, time_base); - // @TODO: Shift av_packet_free() to vcr. This leaks right now. #else av_packet_free_side_data(pkt); av_packet_free(&pkt); + packet->opaque = NULL; #endif break; } @@ -141,12 +143,7 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc // Restore packet rindex in case we reuse it. packet->rindex = rindex; - if (!success) { - codec->handler.callback(codec->handler.userdata, LIANA_CLIENT_ERRORED, codec->handler.stream, NULL); - return false; - } - - return true; + return success; } static void codec_client_flush(struct lia_client_handler *handler) |