From cbce2f4841a9281d10e6d01ee58cfa910965a82c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 12 Jul 2020 20:23:10 -0700 Subject: flush_to_ogg: use enum for audio_or_video Nothing changed, just syntactic sugar to make this more readable --- src/rmd_flush_to_ogg.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/rmd_flush_to_ogg.c b/src/rmd_flush_to_ogg.c index 4a9fb71..b4ca6fb 100644 --- a/src/rmd_flush_to_ogg.c +++ b/src/rmd_flush_to_ogg.c @@ -79,7 +79,10 @@ void *rmdFlushToOgg(ProgData *pdata) { rmdThreadsSetName("rmdFlushToOgg"); while (!(th_st_fin && v_st_fin)) { - int audio_or_video = 0; + enum { + FLUSH_AUDIO, + FLUSH_VIDEO, + } audio_or_video; if (pdata->running) { pthread_mutex_lock(&pdata->libogg_mutex); @@ -167,17 +170,17 @@ void *rmdFlushToOgg(ProgData *pdata) { } if (!audioflag) { - audio_or_video = 1; + audio_or_video = FLUSH_VIDEO; } else if (!videoflag) { - audio_or_video = 0; + audio_or_video = FLUSH_AUDIO; } else { if (audiotime < videotime) - audio_or_video = 0; + audio_or_video = FLUSH_AUDIO; else - audio_or_video = 1; + audio_or_video = FLUSH_VIDEO; } - if (audio_or_video == 1) { + if (audio_or_video == FLUSH_VIDEO) { video_bytesout += fwrite( videopage_copy.header, 1, videopage_copy.header_len, pdata->enc_data->fp); -- cgit v1.2.1