@scrypted/libav 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/decode.cpp +5 -4
package/package.json
CHANGED
package/src/decode.cpp
CHANGED
|
@@ -81,24 +81,25 @@ public:
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// Decode video frames
|
|
84
|
+
int ret;
|
|
84
85
|
while (av_read_frame(fmt_ctx_, packet) >= 0)
|
|
85
86
|
{
|
|
86
87
|
if (packet->stream_index == videoStreamIndex)
|
|
87
88
|
{
|
|
88
|
-
if (avcodec_send_packet(codecContext, packet) == 0)
|
|
89
|
+
if ((ret = avcodec_send_packet(codecContext, packet)) == 0)
|
|
89
90
|
{
|
|
90
|
-
if (avcodec_receive_frame(codecContext, frame) == 0)
|
|
91
|
+
if ((ret = avcodec_receive_frame(codecContext, frame)) == 0)
|
|
91
92
|
{
|
|
92
93
|
av_packet_free(&packet);
|
|
93
94
|
result = frame;
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
else {
|
|
97
|
-
fprintf(stderr, "Error while receiving a frame from the decoder\n");
|
|
98
|
+
fprintf(stderr, "Error while receiving a frame from the decoder: %d\n", ret);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
else {
|
|
101
|
-
fprintf(stderr, "Error while sending a packet to the decoder\n");
|
|
102
|
+
fprintf(stderr, "Error while sending a packet to the decoder: %d\n", ret);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
av_packet_unref(packet); // Reset the packet for the next frame
|