aliakseis / FFmpegPlayer

Simple FFmpeg video player
MIT License
151 stars 44 forks source link

play speed abnormal #18

Closed xixihao123 closed 5 years ago

xixihao123 commented 5 years ago

Hello, I use your video player to play video with audio. When I unplug the headset during playing, the video speed becomes abnormal, why?

xixihao123 commented 5 years ago

Hello, I just tried ffplay to unplug the headset will not be this situation, I would like to ask you this audio implementation can be changed to SDL?

xixihao123 commented 5 years ago

Hello, I just tried again, playing files with audio and video, pull out the ear during the play, the following situation occurred: 1. When using Audio Player Impl to achieve audio playback, it will cause video playback to be very delayed. 2. When using Audio Player Wasapi to achieve audio playback, Will make the video play fast.

aliakseis commented 5 years ago

Probably the situation is being treated as some audio output error and the audio thread either hangs here https://github.com/aliakseis/FFmpegPlayer/blob/49f6da5f9827a5e25716476ac19c77e92fb17f97/Player/AudioPlayerWasapi.cpp#L363 or fails here: https://github.com/aliakseis/FFmpegPlayer/blob/49f6da5f9827a5e25716476ac19c77e92fb17f97/Player/AudioPlayerImpl.cpp#L198 I observed similar behavior, however only when something serious happened, like manual audio driver disabling or sudden system wide failure after wake up from hibernation...

xixihao123 commented 5 years ago

But why would ffplay.exe of ffmpeg not have this situation?

w136111526 commented 5 years ago

@xixihao123 I have find the same issue when pull out the ear during the play

aliakseis commented 5 years ago

Seems to be fixed.

xixihao123 commented 5 years ago

It's OK, thank you very much!

aliakseis commented 5 years ago

You are welcome!