Commit 28dd73a4 authored by Marton Balint's avatar Marton Balint

ffplay: use different decoder names for each media type

Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 2b8458fc
...@@ -2103,10 +2103,10 @@ static int audio_thread(void *arg) ...@@ -2103,10 +2103,10 @@ static int audio_thread(void *arg)
return ret; return ret;
} }
static int decoder_start(Decoder *d, int (*fn)(void *), void *arg) static int decoder_start(Decoder *d, int (*fn)(void *), const char *thread_name, void* arg)
{ {
packet_queue_start(d->queue); packet_queue_start(d->queue);
d->decoder_tid = SDL_CreateThread(fn, "decoder", arg); d->decoder_tid = SDL_CreateThread(fn, thread_name, arg);
if (!d->decoder_tid) { if (!d->decoder_tid) {
av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError()); av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError());
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
...@@ -2676,7 +2676,7 @@ static int stream_component_open(VideoState *is, int stream_index) ...@@ -2676,7 +2676,7 @@ static int stream_component_open(VideoState *is, int stream_index)
is->auddec.start_pts = is->audio_st->start_time; is->auddec.start_pts = is->audio_st->start_time;
is->auddec.start_pts_tb = is->audio_st->time_base; is->auddec.start_pts_tb = is->audio_st->time_base;
} }
if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0) if ((ret = decoder_start(&is->auddec, audio_thread, "audio_decoder", is)) < 0)
goto out; goto out;
SDL_PauseAudioDevice(audio_dev, 0); SDL_PauseAudioDevice(audio_dev, 0);
break; break;
...@@ -2685,7 +2685,7 @@ static int stream_component_open(VideoState *is, int stream_index) ...@@ -2685,7 +2685,7 @@ static int stream_component_open(VideoState *is, int stream_index)
is->video_st = ic->streams[stream_index]; is->video_st = ic->streams[stream_index];
decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread); decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread);
if ((ret = decoder_start(&is->viddec, video_thread, is)) < 0) if ((ret = decoder_start(&is->viddec, video_thread, "video_decoder", is)) < 0)
goto out; goto out;
is->queue_attachments_req = 1; is->queue_attachments_req = 1;
break; break;
...@@ -2694,7 +2694,7 @@ static int stream_component_open(VideoState *is, int stream_index) ...@@ -2694,7 +2694,7 @@ static int stream_component_open(VideoState *is, int stream_index)
is->subtitle_st = ic->streams[stream_index]; is->subtitle_st = ic->streams[stream_index];
decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread); decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread);
if ((ret = decoder_start(&is->subdec, subtitle_thread, is)) < 0) if ((ret = decoder_start(&is->subdec, subtitle_thread, "subtitle_decoder", is)) < 0)
goto out; goto out;
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment