[vlc-commits] [Git][videolan/vlc][master] 2 commits: libvlc: preparser: signal cancellation

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Nov 13 18:24:39 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
90c01a3a by Alaric Senat at 2024-11-13T18:05:12+00:00
libvlc: preparser: signal cancellation

This is in the continuity of aad952ea38f944eca55077d62be9d3d464236a3e.

The previous commit added an internal error code for preparsing
cancellation that wasn't handled in libvlc, the API stopped reporting
preparsing termination, which resulted in a medialibrary regression.

Previously, the cancellation was reported as a timeout event which is
misleading. This patch introduces a new status code to properly match
libvlc's internals.

- - - - -
933ecc78 by Alaric Senat at 2024-11-13T18:05:12+00:00
libvlc: preparser: stop ignoring wrong end status codes

Unexpected status codes sent to the event handler should be treated as a
programming mistake and not silently ignored.

- - - - -


2 changed files:

- include/vlc/libvlc_media.h
- lib/media.c


Changes:

=====================================
include/vlc/libvlc_media.h
=====================================
@@ -184,6 +184,7 @@ typedef enum libvlc_media_parsed_status_t
     libvlc_media_parsed_status_skipped,
     libvlc_media_parsed_status_failed,
     libvlc_media_parsed_status_timeout,
+    libvlc_media_parsed_status_cancelled,
     libvlc_media_parsed_status_done,
 } libvlc_media_parsed_status_t;
 


=====================================
lib/media.c
=====================================
@@ -318,11 +318,14 @@ static void input_item_preparse_ended(input_item_t *item,
         case VLC_ETIMEOUT:
             new_status = libvlc_media_parsed_status_timeout;
             break;
+        case -EINTR:
+            new_status = libvlc_media_parsed_status_cancelled;
+            break;
         case VLC_SUCCESS:
             new_status = libvlc_media_parsed_status_done;
             break;
         default:
-            return;
+            vlc_assert_unreachable();
     }
     send_parsed_changed( p_md, new_status );
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/927a3035cb34b6d2fecb81ebd5ff795cbf149b40...933ecc78a1f3a4a363e70adf3151c6aae7fbe4af

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/927a3035cb34b6d2fecb81ebd5ff795cbf149b40...933ecc78a1f3a4a363e70adf3151c6aae7fbe4af
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list