diff mbox

[FFmpeg-devel,1/3] ffplay: use different decoder names for each media type

Message ID 20190204205317.8978-1-cus@passwd.hu
State Accepted
Commit 28dd73a4437a61340bde29c8fac489ea371ba9cb
Headers show

Commit Message

Marton Balint Feb. 4, 2019, 8:53 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 fftools/ffplay.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Marton Balint Feb. 7, 2019, 11:16 p.m. UTC | #1
On Mon, 4 Feb 2019, Marton Balint wrote:

> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> fftools/ffplay.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index 6a195e5542..97009f322d 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -2103,10 +2103,10 @@ static int audio_thread(void *arg)
>     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);
> -    d->decoder_tid = SDL_CreateThread(fn, "decoder", arg);
> +    d->decoder_tid = SDL_CreateThread(fn, thread_name, arg);
>     if (!d->decoder_tid) {
>         av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError());
>         return AVERROR(ENOMEM);
> @@ -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_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;
>         SDL_PauseAudioDevice(audio_dev, 0);
>         break;
> @@ -2685,7 +2685,7 @@ static int stream_component_open(VideoState *is, int stream_index)
>         is->video_st = ic->streams[stream_index];
>
>         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;
>         is->queue_attachments_req = 1;
>         break;
> @@ -2694,7 +2694,7 @@ static int stream_component_open(VideoState *is, int stream_index)
>         is->subtitle_st = ic->streams[stream_index];
>
>         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;
>         break;
>     default:
> --

Applied the series.

Regards,
Marton
diff mbox

Patch

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 6a195e5542..97009f322d 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -2103,10 +2103,10 @@  static int audio_thread(void *arg)
     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);
-    d->decoder_tid = SDL_CreateThread(fn, "decoder", arg);
+    d->decoder_tid = SDL_CreateThread(fn, thread_name, arg);
     if (!d->decoder_tid) {
         av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError());
         return AVERROR(ENOMEM);
@@ -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_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;
         SDL_PauseAudioDevice(audio_dev, 0);
         break;
@@ -2685,7 +2685,7 @@  static int stream_component_open(VideoState *is, int stream_index)
         is->video_st = ic->streams[stream_index];
 
         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;
         is->queue_attachments_req = 1;
         break;
@@ -2694,7 +2694,7 @@  static int stream_component_open(VideoState *is, int stream_index)
         is->subtitle_st = ic->streams[stream_index];
 
         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;
         break;
     default: