[MPlayer-dev-eng] [PATCH 5/5] Various rectifications uncrustify wasn't able to do.

Clément Bœsch ubitux at gmail.com
Thu May 5 15:00:17 CEST 2011


On Sat, Apr 16, 2011 at 12:02:53AM +0200, Clément Bœsch wrote:
> Due to uncrustify and A.I. limitations, humans are still needed
> sometimes.
> ---
>  mplayer.c |  283 +++++++++++++++++++++++++------------------------------------
>  1 files changed, 114 insertions(+), 169 deletions(-)
> 

Patch updated. No more functionnal changes, and more cosmetics, vertical
align & stuff. It follows the uncrustify patch.

-- 
Clément B.
-------------- next part --------------
From 928b53aa894044b0edd5cef29d93dc49649364f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Thu, 5 May 2011 14:56:54 +0200
Subject: [PATCH] Various rectifications uncrustify wasn't able to do.

Due to uncrustify and A.I. limitations, humans are still needed
sometimes.
---
 mplayer.c |  266 +++++++++++++++++++++++++------------------------------------
 1 files changed, 108 insertions(+), 158 deletions(-)

diff --git a/mplayer.c b/mplayer.c
index 6103e97..1768059 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -320,19 +320,19 @@ static int nortc = 1;
 static char *rtc_device;
 #endif
 
-edl_record_ptr edl_records; ///< EDL entries memory area
+edl_record_ptr edl_records;     ///< EDL entries memory area
 edl_record_ptr next_edl_record; ///< only for traversing edl_records
-short edl_decision; ///< 1 when an EDL operation has been made.
-short edl_needs_reset; ///< 1 if we need to reset EDL next pointer
-short edl_backward; ///< 1 if we need to skip to the beginning of the next EDL record
-FILE *edl_fd; ///< fd to write to when in -edlout mode.
+short edl_decision;             ///< 1 when an EDL operation has been made.
+short edl_needs_reset;          ///< 1 if we need to reset EDL next pointer
+short edl_backward;             ///< 1 if we need to skip to the beginning of the next EDL record
+FILE *edl_fd;                   ///< fd to write to when in -edlout mode.
 // Number of seconds to add to the seek when jumping out
 // of EDL scene in backward direction. This is needed to
 // have some time after the seek to decide what to do next
 // (next seek, pause,...), otherwise after the seek it will
 // enter the same scene again and skip forward immediately
 float edl_backward_delay = 2;
-int edl_start_pts; ///< Automatically add/sub this from EDL start/stop pos
+int edl_start_pts;              ///< Automatically add/sub this from EDL start/stop pos
 int use_filedir_conf;
 int use_filename_title;
 
@@ -449,16 +449,11 @@ char *get_metadata(metadata_t type)
         return strdup(mp_basename(filename));
 
     case META_VIDEO_CODEC:
-        if (sh_video->format == 0x10000001)
-            return strdup("mpeg1");
-        else if (sh_video->format == 0x10000002)
-            return strdup("mpeg2");
-        else if (sh_video->format == 0x10000004)
-            return strdup("mpeg4");
-        else if (sh_video->format == 0x10000005)
-            return strdup("h264");
-        else if (sh_video->format >= 0x20202020)
-            return mp_asprintf("%.4s", (char *)&sh_video->format);
+             if (sh_video->format == 0x10000001) return strdup("mpeg1");
+        else if (sh_video->format == 0x10000002) return strdup("mpeg2");
+        else if (sh_video->format == 0x10000004) return strdup("mpeg4");
+        else if (sh_video->format == 0x10000005) return strdup("h264");
+        else if (sh_video->format >= 0x20202020) return mp_asprintf("%.4s", (char *)&sh_video->format);
         return mp_asprintf("0x%08X", sh_video->format);
 
     case META_VIDEO_BITRATE:
@@ -479,26 +474,13 @@ char *get_metadata(metadata_t type)
         return mp_asprintf("%d Hz, %d ch.", sh_audio->samplerate, sh_audio->channels);
 
     /* check for valid demuxer */
-    case META_INFO_TITLE:
-        return get_demuxer_info("Title");
-
-    case META_INFO_ARTIST:
-        return get_demuxer_info("Artist");
-
-    case META_INFO_ALBUM:
-        return get_demuxer_info("Album");
-
-    case META_INFO_YEAR:
-        return get_demuxer_info("Year");
-
-    case META_INFO_COMMENT:
-        return get_demuxer_info("Comment");
-
-    case META_INFO_TRACK:
-        return get_demuxer_info("Track");
-
-    case META_INFO_GENRE:
-        return get_demuxer_info("Genre");
+    case META_INFO_TITLE:   return get_demuxer_info("Title");
+    case META_INFO_ARTIST:  return get_demuxer_info("Artist");
+    case META_INFO_ALBUM:   return get_demuxer_info("Album");
+    case META_INFO_YEAR:    return get_demuxer_info("Year");
+    case META_INFO_COMMENT: return get_demuxer_info("Comment");
+    case META_INFO_TRACK:   return get_demuxer_info("Track");
+    case META_INFO_GENRE:   return get_demuxer_info("Genre");
 
     default:
         break;
@@ -516,14 +498,14 @@ static void print_file_properties(const MPContext *mpctx, const char *filename)
     if (mpctx->sh_video) {
         /* Assume FOURCC if all bytes >= 0x20 (' ') */
         if (mpctx->sh_video->format >= 0x20202020)
-            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_FORMAT=%.4s\n", (char *)&mpctx->sh_video->format);
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_FORMAT=%.4s\n",   (char *)&mpctx->sh_video->format);
         else
             mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_FORMAT=0x%08X\n", mpctx->sh_video->format);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_BITRATE=%d\n", mpctx->sh_video->i_bps * 8);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_WIDTH=%d\n", mpctx->sh_video->disp_w);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_HEIGHT=%d\n", mpctx->sh_video->disp_h);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_FPS=%5.3f\n", mpctx->sh_video->fps);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ASPECT=%1.4f\n", mpctx->sh_video->aspect);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_VIDEO_BITRATE=%d\n",    mpctx->sh_video->i_bps * 8);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_VIDEO_WIDTH=%d\n",      mpctx->sh_video->disp_w);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_VIDEO_HEIGHT=%d\n",     mpctx->sh_video->disp_h);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_VIDEO_FPS=%5.3f\n",     mpctx->sh_video->fps);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_VIDEO_ASPECT=%1.4f\n",  mpctx->sh_video->aspect);
         video_start_pts = ds_get_next_pts(mpctx->d_video);
     }
     if (mpctx->sh_audio) {
@@ -531,10 +513,10 @@ static void print_file_properties(const MPContext *mpctx, const char *filename)
         if (mpctx->sh_audio->format >= 0x20202020)
             mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_FORMAT=%.4s\n", (char *)&mpctx->sh_audio->format);
         else
-            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_FORMAT=%d\n", mpctx->sh_audio->format);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_BITRATE=%d\n", mpctx->sh_audio->i_bps * 8);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_RATE=%d\n", mpctx->sh_audio->samplerate);
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_NCH=%d\n", mpctx->sh_audio->channels);
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_FORMAT=%d\n",   mpctx->sh_audio->format);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_AUDIO_BITRATE=%d\n",  mpctx->sh_audio->i_bps * 8);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_AUDIO_RATE=%d\n",     mpctx->sh_audio->samplerate);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO,     "ID_AUDIO_NCH=%d\n",      mpctx->sh_audio->channels);
         start_pts = ds_get_next_pts(mpctx->d_audio);
     }
     if (video_start_pts != MP_NOPTS_VALUE) {
@@ -567,7 +549,6 @@ static void mp_dvdnav_context_free(MPContext *ctx)
     ctx->nav_start   = NULL;
     ctx->nav_in_size = 0;
 }
-
 #endif
 
 void uninit_player(unsigned int mask)
@@ -788,9 +769,8 @@ void exit_player(enum exit_reason how)
 static void child_sighandler(int x)
 {
     pid_t pid;
-    while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) ;
+    while ((pid = waitpid(-1, NULL, WNOHANG)) > 0);
 }
-
 #endif
 
 static void exit_sighandler(int x)
@@ -1046,14 +1026,11 @@ static int playtree_add_playlist(play_tree_t *entry)
     {
         if (!entry) {
             entry = mpctx->playtree_iter->tree;
-            if (play_tree_iter_step(mpctx->playtree_iter, 1, 0) != PLAY_TREE_ITER_ENTRY) {
+            if (play_tree_iter_step(mpctx->playtree_iter, 1, 0) != PLAY_TREE_ITER_ENTRY)
                 return PT_NEXT_ENTRY;
-            }
-            if (mpctx->playtree_iter->tree == entry) { // Loop with a single file
-                if (play_tree_iter_up_step(mpctx->playtree_iter, 1, 0) != PLAY_TREE_ITER_ENTRY) {
+            if (mpctx->playtree_iter->tree == entry) // Loop with a single file
+                if (play_tree_iter_up_step(mpctx->playtree_iter, 1, 0) != PLAY_TREE_ITER_ENTRY)
                     return PT_NEXT_ENTRY;
-                }
-            }
             play_tree_remove(entry, 1, 1);
             return PT_NEXT_SRC;
         }
@@ -1075,9 +1052,8 @@ void add_subtitles(char *filename, float fps, int noerr)
     ASS_Track *asst = 0;
 #endif
 
-    if (filename == NULL || mpctx->set_of_sub_size >= MAX_SUBTITLE_FILES) {
+    if (filename == NULL || mpctx->set_of_sub_size >= MAX_SUBTITLE_FILES)
         return;
-    }
 
     subd = sub_read_file(filename, fps);
 #ifdef CONFIG_ASS
@@ -1615,24 +1591,24 @@ static void update_osd_msg(void)
                 percentage_text[0] = 0;
 
             if (osd_fractions == 1) {
-                //print fractions as sub-second timestamp
+                // print fractions as sub-second timestamp
                 snprintf(fractions_text, sizeof(fractions_text), ".%02d",
                          (int)((mpctx->sh_video->pts - pts) * 100 + 0.5)
                          % 100);
             } else if (osd_fractions == 2) {
-                //print fractions by estimating the frame count within the
-                //second
-
-                //rounding or cutting off numbers after the decimal point
-                //causes problems because of float's precision and movies,
-                //whose first frame is not exactly at timestamp 0. Therefore,
-                //we add 0.2 and cut off at the decimal point, which proved
-                //as good heuristic
+                // print fractions by estimating the frame count within the
+                // second
+
+                // rounding or cutting off numbers after the decimal point
+                // causes problems because of float's precision and movies,
+                // whose first frame is not exactly at timestamp 0. Therefore,
+                // we add 0.2 and cut off at the decimal point, which proved
+                // as good heuristic
                 snprintf(fractions_text, sizeof(fractions_text), ".%02d",
                          (int)((mpctx->sh_video->pts - pts) *
                                mpctx->sh_video->fps + 0.2));
             } else {
-                //do not print fractions
+                // do not print fractions
                 fractions_text[0] = 0;
             }
 
@@ -1674,9 +1650,8 @@ void reinit_audio_chain(void)
     if (!(initialized_flags & INITIALIZED_ACODEC)) {
         current_module = "init_audio_codec";
         mp_msg(MSGT_CPLAYER, MSGL_INFO, "==========================================================================\n");
-        if (!init_best_audio_codec(mpctx->sh_audio, audio_codec_list, audio_fm_list)) {
+        if (!init_best_audio_codec(mpctx->sh_audio, audio_codec_list, audio_fm_list))
             goto init_error;
-        }
         initialized_flags |= INITIALIZED_ACODEC;
         mp_msg(MSGT_CPLAYER, MSGL_INFO, "==========================================================================\n");
     }
@@ -1784,8 +1759,9 @@ static int check_framedrop(double frame_time)
             ++drop_frame_cnt;
             ++dropped_frames;
             return frame_dropping;
-        } else
+        } else {
             dropped_frames = 0;
+        }
     }
     return 0;
 }
@@ -1927,9 +1903,9 @@ static mp_image_t *mp_dvdnav_copy_mpi(mp_image_t *to_mpi,
     if (to_mpi &&
         to_mpi->w == from_mpi->w &&
         to_mpi->h == from_mpi->h &&
-        to_mpi->imgfmt == from_mpi->imgfmt)
+        to_mpi->imgfmt == from_mpi->imgfmt) {
         mpi = to_mpi;
-    else {
+    } else {
         if (to_mpi)
             free_mp_image(to_mpi);
         if (from_mpi->w == 0 || from_mpi->h == 0)
@@ -2531,8 +2507,9 @@ static void pause_loop(void)
         if (term_osd && !mpctx->sh_video) {
             set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused);
             update_osd_msg();
-        } else
+        } else {
             mp_msg(MSGT_CPLAYER, MSGL_STATUS, "\n"MSGTR_Paused "\r");
+        }
         mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n");
     }
 #ifdef CONFIG_GUI
@@ -2574,9 +2551,10 @@ static void pause_loop(void)
                     set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused " %d%%",
                                 new_cache_fill);
                     update_osd_msg();
-                } else
+                } else {
                     mp_msg(MSGT_CPLAYER, MSGL_STATUS, MSGTR_Paused " %d%%\r",
                            new_cache_fill);
+                }
                 old_cache_fill = new_cache_fill;
             }
         }
@@ -2623,9 +2601,8 @@ static void edl_loadfile(void)
 // Execute EDL command for the current position if one exists
 static void edl_update(MPContext *mpctx)
 {
-    if (!edl_records) {
+    if (!edl_records)
         return;
-    }
 
     if (!mpctx->sh_video) {
         mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video);
@@ -2698,7 +2675,7 @@ static void edl_update(MPContext *mpctx)
 }
 
 // style & SEEK_ABSOLUTE == 0 means seek relative to current position, == 1 means absolute
-// style & SEEK_FACTOR == 0 means amount in seconds, == 2 means fraction of file length
+// style & SEEK_FACTOR   == 0 means amount in seconds, == 2 means fraction of file length
 // return -1 if seek failed (non-seekable stream?), 0 otherwise
 static int seek(MPContext *mpctx, double amount, int style)
 {
@@ -2761,10 +2738,7 @@ static int seek(MPContext *mpctx, double amount, int style)
 #ifndef DISABLE_MAIN
 int main(int argc, char *argv[])
 {
-// movie info:
-
-/* Flag indicating whether MPlayer should exit without playing anything. */
-    int opt_exit = 0;
+    int opt_exit = 0; // Flag indicating whether MPlayer should exit without playing anything.
     int i;
 
     int gui_no_filename = 0;
@@ -2799,9 +2773,9 @@ int main(int argc, char *argv[])
 #endif
 
     mpctx->playtree = m_config_parse_mp_command_line(mconfig, argc, argv);
-    if (mpctx->playtree == NULL)
+    if (mpctx->playtree == NULL) {
         opt_exit = 1;
-    else {
+    } else {
         mpctx->playtree = play_tree_cleanup(mpctx->playtree);
         if (mpctx->playtree) {
             mpctx->playtree_iter = play_tree_iter_new(mpctx->playtree, mconfig);
@@ -2973,8 +2947,8 @@ int main(int argc, char *argv[])
         }
     }
 #ifdef CONFIG_GUI
-// breaks DGA and SVGAlib and VESA drivers:  --A'rpi
-// and now ? -- Pontscho
+    // breaks DGA and SVGAlib and VESA drivers:  --A'rpi
+    // and now ? -- Pontscho
     if (use_gui)
         setuid(getuid());           // strongly test, please check this.
 #endif
@@ -2990,7 +2964,7 @@ int main(int argc, char *argv[])
 
 // ========== Init keyboard FIFO (connection to libvo) ============
 
-// Init input system
+    // Init input system
     current_module = "init_input";
     mp_input_init();
     mp_input_add_key_fd(-1, 0, mplayer_get_key, NULL);
@@ -2998,7 +2972,7 @@ int main(int argc, char *argv[])
         mp_input_add_cmd_fd(0, USE_SELECT, MP_INPUT_SLAVE_CMD_FUNC, NULL);
     else if (!noconsolecontrols)
         mp_input_add_event_fd(0, getch2);
-// Set the libstream interrupt callback
+    // Set the libstream interrupt callback
     stream_set_interrupt_callback(mp_input_check_interrupt);
 
 #ifdef CONFIG_MENU
@@ -3082,8 +3056,8 @@ play_next_file:
     if (audio_driver_list)
         load_per_output_config(mconfig, PROFILE_CFG_AO, audio_driver_list[0]);
 
-// We must enable getch2 here to be able to interrupt network connection
-// or cache filling
+    // We must enable getch2 here to be able to interrupt network connection
+    // or cache filling
     if (!noconsolecontrols && !slave_mode) {
         if (initialized_flags & INITIALIZED_GETCH2)
             mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_Getch2InitializedTwice);
@@ -3306,19 +3280,15 @@ play_next_file:
     }
 
     if (mpctx->stream->type == STREAMTYPE_BD) {
-        if (audio_lang && audio_id == -1)
-            audio_id = bd_aid_from_lang(mpctx->stream, audio_lang);
-        if (dvdsub_lang && dvdsub_id == -1)
-            dvdsub_id = bd_sid_from_lang(mpctx->stream, dvdsub_lang);
+        if (audio_lang  && audio_id  == -1) audio_id  = bd_aid_from_lang(mpctx->stream, audio_lang);
+        if (dvdsub_lang && dvdsub_id == -1) dvdsub_id = bd_sid_from_lang(mpctx->stream, dvdsub_lang);
     }
 
 #ifdef CONFIG_DVDREAD
     if (mpctx->stream->type == STREAMTYPE_DVD) {
         current_module = "dvd lang->id";
-        if (audio_lang && audio_id == -1)
-            audio_id = dvd_aid_from_lang(mpctx->stream, audio_lang);
-        if (dvdsub_lang && dvdsub_id == -1)
-            dvdsub_id = dvd_sid_from_lang(mpctx->stream, dvdsub_lang);
+        if (audio_lang  && audio_id  == -1) audio_id  = dvd_aid_from_lang(mpctx->stream, audio_lang);
+        if (dvdsub_lang && dvdsub_id == -1) dvdsub_id = dvd_sid_from_lang(mpctx->stream, dvdsub_lang);
         // setup global sub numbering
         mpctx->sub_counts[SUB_SOURCE_DEMUX] = dvd_number_of_subs(mpctx->stream);
         current_module = NULL;
@@ -3345,7 +3315,7 @@ goto_enable_cache:
         int res;
         current_module = "enable_cache";
         res = stream_enable_cache(mpctx->stream, stream_cache_size * 1024,
-                                  stream_cache_size * 1024 * (stream_cache_min_percent / 100.0),
+                                  stream_cache_size * 1024 * (stream_cache_min_percent      / 100.0),
                                   stream_cache_size * 1024 * (stream_cache_seek_min_percent / 100.0));
         if (res == 0)
             if ((mpctx->eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY)))
@@ -3357,8 +3327,7 @@ goto_enable_cache:
 
     mpctx->demuxer = demux_open(mpctx->stream, mpctx->file_format, audio_id, video_id, dvdsub_id, filename);
 
-// HACK to get MOV Reference Files working
-
+    // HACK to get MOV Reference Files working
     if (mpctx->demuxer && mpctx->demuxer->type == DEMUXER_TYPE_PLAYLIST) {
         unsigned char *playlist_entry;
         play_tree_t *list = NULL, *entry = NULL;
@@ -3446,40 +3415,28 @@ goto_enable_cache:
         int tmp = ts_prog;
         mp_property_do("switch_program", M_PROPERTY_SET, &tmp, mpctx);
     }
-// select audio stream
+    // select audio stream
     select_audio(mpctx->demuxer, audio_id, audio_lang);
 
-// DUMP STREAMS:
+    // DUMP STREAMS:
     if ((stream_dump_type) && (stream_dump_type < 4)) {
         FILE *f;
         demux_stream_t *ds = NULL;
         current_module = "dump";
         // select stream to dump
         switch (stream_dump_type) {
-        case 1: ds = mpctx->d_audio;
-            break;
-        case 2: ds = mpctx->d_video;
-            break;
-        case 3: ds = mpctx->d_sub;
-            break;
+        case 1: ds = mpctx->d_audio; break;
+        case 2: ds = mpctx->d_video; break;
+        case 3: ds = mpctx->d_sub;   break;
         }
         if (!ds) {
             mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_DumpSelectedStreamMissing);
             exit_player(EXIT_ERROR);
         }
         // disable other streams:
-        if (mpctx->d_audio && mpctx->d_audio != ds) {
-            ds_free_packs(mpctx->d_audio);
-            mpctx->d_audio->id = -2;
-        }
-        if (mpctx->d_video && mpctx->d_video != ds) {
-            ds_free_packs(mpctx->d_video);
-            mpctx->d_video->id = -2;
-        }
-        if (mpctx->d_sub && mpctx->d_sub != ds) {
-            ds_free_packs(mpctx->d_sub);
-            mpctx->d_sub->id = -2;
-        }
+        if (mpctx->d_audio && mpctx->d_audio != ds) { ds_free_packs(mpctx->d_audio); mpctx->d_audio->id = -2; }
+        if (mpctx->d_video && mpctx->d_video != ds) { ds_free_packs(mpctx->d_video); mpctx->d_video->id = -2; }
+        if (mpctx->d_sub   && mpctx->d_sub   != ds) { ds_free_packs(mpctx->d_sub);   mpctx->d_sub->id   = -2; }
         // let's dump it!
         f = fopen(stream_dump_name, "wb");
         if (!f) {
@@ -3551,7 +3508,7 @@ goto_enable_cache:
         goto goto_next_file; // exit_player(MSGTR_Exit_error);
     }
 
-/* display clip info */
+    /* display clip info */
     demux_info_print(mpctx->demuxer);
 
 //================== Read SUBTITLES (DVD & TEXT) ==========================
@@ -3561,9 +3518,9 @@ goto_enable_cache:
     }
 
     if (1 || mpctx->sh_video) {
-// after reading video params we should load subtitles because
-// we know fps so now we can adjust subtitle time to ~6 seconds AST
-// check .sub
+        // after reading video params we should load subtitles because
+        // we know fps so now we can adjust subtitle time to ~6 seconds AST
+        // check .sub
         double fps = mpctx->sh_video ? mpctx->sh_video->fps : 25;
         current_module = "read_subtitles_file";
         load_subtitles(filename, fps, add_subtitles);
@@ -3574,21 +3531,16 @@ goto_enable_cache:
     }
 
     if (select_subtitle(mpctx)) {
-        if (subdata)
+        if (subdata) {
             switch (stream_dump_type) {
-            case 3: list_sub_file(subdata);
-                break;
-            case 4: dump_mpsub(subdata, mpctx->sh_video->fps);
-                break;
-            case 6: dump_srt(subdata, mpctx->sh_video->fps);
-                break;
-            case 7: dump_microdvd(subdata, mpctx->sh_video->fps);
-                break;
-            case 8: dump_jacosub(subdata, mpctx->sh_video->fps);
-                break;
-            case 9: dump_sami(subdata, mpctx->sh_video->fps);
-                break;
+            case 3: list_sub_file(subdata);                         break;
+            case 4: dump_mpsub(subdata,     mpctx->sh_video->fps);  break;
+            case 6: dump_srt(subdata,       mpctx->sh_video->fps);  break;
+            case 7: dump_microdvd(subdata,  mpctx->sh_video->fps);  break;
+            case 8: dump_jacosub(subdata,   mpctx->sh_video->fps);  break;
+            case 9: dump_sami(subdata,      mpctx->sh_video->fps);  break;
             }
+        }
     }
 
     print_file_properties(mpctx, filename);
@@ -3625,7 +3577,7 @@ goto_enable_cache:
         free(msg);
     }
 
-// Disable the term OSD in verbose mode
+    // Disable the term OSD in verbose mode
     if (verbose)
         term_osd = 0;
 
@@ -3633,8 +3585,8 @@ goto_enable_cache:
         mpctx->num_buffered_frames = 0;
         mpctx->framestep_found     = 0;
 
-// Make sure old OSD does not stay around,
-// e.g. with -fixed-vo and same-resolution files
+        // Make sure old OSD does not stay around,
+        // e.g. with -fixed-vo and same-resolution files
         clear_osd_msgs();
         update_osd_msg();
 
@@ -3679,7 +3631,7 @@ goto_enable_cache:
         if (!mpctx->sh_video && !mpctx->sh_audio)
             goto goto_next_file;
 
-//if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf!
+        //if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf!
         if (force_fps && mpctx->sh_video) {
             vo_fps = mpctx->sh_video->fps = force_fps;
             mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
@@ -3704,11 +3656,9 @@ goto_enable_cache:
 #endif
 
         mp_input_set_section(NULL);
-//TODO: add desired (stream-based) sections here
-        if (mpctx->stream->type == STREAMTYPE_TV)
-            mp_input_set_section("tv");
-        if (mpctx->stream->type == STREAMTYPE_DVDNAV)
-            mp_input_set_section("dvdnav");
+        //TODO: add desired (stream-based) sections here
+        if (mpctx->stream->type == STREAMTYPE_TV)     mp_input_set_section("tv");
+        if (mpctx->stream->type == STREAMTYPE_DVDNAV) mp_input_set_section("dvdnav");
 
 //==================== START PLAYING =======================
 
@@ -3878,20 +3828,20 @@ goto_enable_cache:
 
 //============================ Auto QUALITY ============================
 
-/*Output quality adjustments:*/
+                /* Output quality adjustments: */
                 if (auto_quality > 0) {
                     current_module = "autoq";
-//  float total=0.000001f * (GetTimer()-aq_total_time);
-//  if(output_quality<auto_quality && aq_sleep_time>0.05f*total)
+                    //float total=0.000001f * (GetTimer()-aq_total_time);
+                    //if(output_quality<auto_quality && aq_sleep_time>0.05f*total)
                     if (output_quality < auto_quality && aq_sleep_time > 0)
                         ++output_quality;
                     else
-//  if(output_quality>0 && aq_sleep_time<-0.05f*total)
+                    //if(output_quality>0 && aq_sleep_time<-0.05f*total)
                     if (output_quality > 1 && aq_sleep_time < 0)
                         --output_quality;
                     else if (output_quality > 0 && aq_sleep_time < -0.050f) // 50ms
                         output_quality = 0;
-//  printf("total: %8.6f  sleep: %8.6f  q: %d\n",(0.000001f*aq_total_time),aq_sleep_time,output_quality);
+                    //printf("total: %8.6f  sleep: %8.6f  q: %d\n",(0.000001f*aq_total_time),aq_sleep_time,output_quality);
                     set_video_quality(mpctx->sh_video, output_quality);
                 }
 
@@ -3940,7 +3890,7 @@ goto_enable_cache:
                 pause_loop();
             }
 
-// handle -sstep
+            // handle -sstep
             if (step_sec > 0) {
                 mpctx->osd_function = OSD_FFW;
                 rel_seek_secs      += step_sec;
@@ -4062,9 +4012,9 @@ goto_next_file:  // don't jump here after ao/vo/getch initialization!
                total_time_usage - tot, total_time_usage);
         if (total_time_usage > 0.0)
             mp_msg(MSGT_CPLAYER, MSGL_INFO, "BENCHMARK%%: VC:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
-                   100.0 * video_time_usage / total_time_usage,
-                   100.0 * vout_time_usage / total_time_usage,
-                   100.0 * audio_time_usage / total_time_usage,
+                   100.0 * video_time_usage         / total_time_usage,
+                   100.0 * vout_time_usage          / total_time_usage,
+                   100.0 * audio_time_usage         / total_time_usage,
                    100.0 * (total_time_usage - tot) / total_time_usage,
                    100.0);
         if (total_frame_cnt && frame_dropping)
@@ -4077,7 +4027,7 @@ goto_next_file:  // don't jump here after ao/vo/getch initialization!
                    (total_time_usage > 0.5) ? (total_frame_cnt / total_time_usage) : 0);
     }
 
-// time to uninit all, except global stuff:
+    // time to uninit all, except global stuff:
     uninit_player(INITIALIZED_ALL - (INITIALIZED_GUI + INITIALIZED_INPUT + (fixed_vo ? INITIALIZED_VO : 0)));
 
     if (mpctx->eof == PT_NEXT_ENTRY || mpctx->eof == PT_PREV_ENTRY) {
@@ -4116,8 +4066,9 @@ goto_next_file:  // don't jump here after ao/vo/getch initialization!
                 play_tree_iter_free(mpctx->playtree_iter);
                 mpctx->playtree_iter = NULL;
             }
-        } else
+        } else {
             break;
+        }
     }
 
 #ifdef CONFIG_GUI
@@ -4137,7 +4088,6 @@ goto_next_file:  // don't jump here after ao/vo/getch initialization!
     }
 
     exit_player_with_rc(EXIT_EOF, 0);
-
     return 1;
 }
 
-- 
1.7.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110505/48f228df/attachment-0001.asc>


More information about the MPlayer-dev-eng mailing list