mirror of
https://github.com/mpv-player/mpv
synced 2025-04-27 22:00:23 +00:00
Handle "out of memory" error.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25086 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5c684e7e4c
commit
c8b82b4b80
@ -2419,6 +2419,8 @@ static HRESULT build_video_chain(priv_t *priv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
priv->v_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
priv->v_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
||||||
|
if(!priv->v_buf)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if (priv->tv_param->buffer_size >= 0) {
|
if (priv->tv_param->buffer_size >= 0) {
|
||||||
priv->v_buf->buffersize = priv->tv_param->buffer_size;
|
priv->v_buf->buffersize = priv->tv_param->buffer_size;
|
||||||
@ -2458,6 +2460,8 @@ static HRESULT build_audio_chain(priv_t *priv)
|
|||||||
|
|
||||||
if(priv->pmtAudio){
|
if(priv->pmtAudio){
|
||||||
priv->a_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
priv->a_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
||||||
|
if(!priv->a_buf)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
/* let the audio buffer be the same size (in seconds) than video one */
|
/* let the audio buffer be the same size (in seconds) than video one */
|
||||||
priv->a_buf->buffersize=audio_buf_size_from_video(
|
priv->a_buf->buffersize=audio_buf_size_from_video(
|
||||||
@ -2488,6 +2492,9 @@ static HRESULT build_vbi_chain(priv_t *priv)
|
|||||||
if(priv->tv_param->tdevice)
|
if(priv->tv_param->tdevice)
|
||||||
{
|
{
|
||||||
priv->vbi_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
priv->vbi_buf=calloc(1,sizeof(grabber_ringbuffer_t));
|
||||||
|
if(!priv->vbi_buf)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
init_ringbuffer(priv->vbi_buf,24,priv->tsp.bufsize);
|
init_ringbuffer(priv->vbi_buf,24,priv->tsp.bufsize);
|
||||||
|
|
||||||
priv->pmtVBI=calloc(1,sizeof(AM_MEDIA_TYPE));
|
priv->pmtVBI=calloc(1,sizeof(AM_MEDIA_TYPE));
|
||||||
|
Loading…
Reference in New Issue
Block a user