0

I try to using live555(a.k.a OpenRTSP) to setup RTSP server and client.
My Client application using live555, ffmpeg and SDL as streaming, decode and playback.

I found it might have deadlock if I try to call SDL_CloseAudio as following situation:

  • When RTSP is down.
  • When network is broken.

I am exclude it related to any timing issue because it works well if I try to call SDL_CloseAudio when server is not down.

Also, I have tried following API but still not work:

  • Try SDL_PauseAudio before close it.
  • Try SDL_UnlockAudio before close it.

Any idea for this?

Evan Lin
  • 1,272
  • 1
  • 12
  • 25

1 Answers1

0

After I trace the SDL source code, I found it may related to mutex when SDL still under process SDL_RunAudio

Also, according my situation it will works well if the network still work (or server not down). So I try to send a kilo-byte fake audio data with "0" before close it.

    PacketQueue             m_audioq; //working queue.

    AVPacket *pktAudio = NULL;
    uint8_t data[1024] = {0};
    pktAudio = (AVPacket*)av_malloc(sizeof(AVPacket));
    av_init_packet(pktAudio);
    pktAudio->data = data;
    pktAudio->size = 1024;
    packet_queue_put(&m_audioq, pktAudio);

    SDL_CloseAudio();
Evan Lin
  • 1,272
  • 1
  • 12
  • 25