several rtsp stream decoding.

I’m making a nvr viewer in linux.
Rtsp stream is 20 to 50.

I refer to AppDecGL in Video codec sdk 9.0.
Unexpectedly NvDecoder::Decode() method return 0 frame or 1 frame or 13 frames.
I want to return a decoded frame if i call the function Decode().
Is it possible? How to make it?

Thanks.
Regards.