plug leaks, leaker tweaks, lang for effect info, c41 spiffs, wm probe tweaks
[goodguy/history.git] / cinelerra-5.1 / cinelerra / playtransport.C
index 85fe95a446a9252cd6d5bd935b8cfffc99c6cb0b..38a5725f1cc7333d0979afcd6872f957aa978d7e 100644 (file)
@@ -216,6 +216,9 @@ int PlayTransport::keypress_event()
                case STOP:
                        command = NORMAL_FWD;
                        break;
+               default:
+                       command = STOP;
+                       break;
                }
                break;
        default:
@@ -252,8 +255,12 @@ void PlayTransport::handle_transport(int command,
        int resume = 0;
 //printf("PlayTransport::handle_transport 1 %d\n", command);
        int prev_command = engine->command->command;
-       int prev_direction = engine->command->get_direction();
        int prev_single_frame = engine->command->single_frame();
+       int prev_audio = engine->command->audio_toggle ?
+                !prev_single_frame : prev_single_frame;
+       int cur_single_frame = TransportCommand::single_frame(command);
+       int cur_audio = toggle_audio ?
+                !cur_single_frame : cur_single_frame;
 
 // Dispatch command
        switch(command) {
@@ -265,8 +272,10 @@ void PlayTransport::handle_transport(int command,
        case SLOW_FWD:
        case NORMAL_FWD:
        case FAST_FWD:
-               if( prev_command == command && !prev_single_frame ) {
-// Same direction pressed twice.  Stop
+               if( !prev_single_frame &&
+                   prev_command == command &&
+                   cur_audio == prev_audio ) {
+// Same direction pressed twice and no change in audio state,  Stop
                        do_stop = 1;
                        break;
                }
@@ -303,16 +312,6 @@ void PlayTransport::handle_transport(int command,
        if( do_stop ) {
                engine->que->send_command(STOP, CHANGE_NONE, 0, 0, 0, 0);
                engine->interrupt_playback(wait_tracking);
-// This is necessary to get an OpenGL output buffer
-// printf("PlayTransport::handle_transport 2 update_refresh=%d prev_command=%d prev_direction=%d\n",
-// update_refresh, prev_command, prev_direction);
-               if( !prev_single_frame && update_refresh &&
-                   prev_command != STOP && prev_command != COMMAND_NONE ) {
-                       int command = (prev_direction == PLAY_FORWARD) ?
-                                       SINGLE_FRAME_REWIND : SINGLE_FRAME_FWD;
-                       engine->que->send_command(command,
-                               CHANGE_NONE, get_edl(), 1, 0, 0);
-               }
        }
 }