summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-12 20:23:10 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-12 20:23:10 -0700
commitcbce2f4841a9281d10e6d01ee58cfa910965a82c (patch)
tree52895967fa01903c1693592c59b518fce11038f3
parente63ff24cec64326eee3cb94f78aedaeb3f829a59 (diff)
flush_to_ogg: use enum for audio_or_video
Nothing changed, just syntactic sugar to make this more readable
-rw-r--r--src/rmd_flush_to_ogg.c15
1 files 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);
© All Rights Reserved