]> git.nihav.org Git - nihav.git/commitdiff
use common definition for forcing stream tag option
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 9 Jun 2026 18:39:10 +0000 (20:39 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 9 Jun 2026 18:39:10 +0000 (20:39 +0200)
nihav-commonfmt/src/muxers/avi.rs
nihav-core/src/options.rs

index b38e8174d67f2bc9272670817ac5fd82e65cde9b..403a252315a5efe09545e74c6d5940d356459318 100644 (file)
@@ -588,7 +588,7 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
 
 const MUXER_OPTS: &[NAOptionDefinition] = &[
     NAOptionDefinition {
-        name: "stream_tag", description: "forced stream tag(s) in 'streamNtagHHHHHHHH' format",
+        name: FORCE_STREAM_TAG_OPTION, description: FORCE_STREAM_TAG_OPTION_DESC,
         opt_type: NAOptionDefinitionType::String(None) },
 ];
 
@@ -632,7 +632,7 @@ impl<'a> NAOptionHandler for AVIMuxer<'a> {
     fn get_supported_options(&self) -> &[NAOptionDefinition] { MUXER_OPTS }
     fn set_options(&mut self, options: &[NAOption]) {
         for opt in options.iter() {
-            if let NAOption { name: "stream_tag" , value: NAValue::String(ref stag) } = opt {
+            if let NAOption { name: FORCE_STREAM_TAG_OPTION , value: NAValue::String(ref stag) } = opt {
                 if let Some(new_tag) = parse_tag(stag.as_bytes()) {
                     let mut found = false;
                     for tag in self.forced_tags.iter_mut() {
index 32baa64bb5f89ab9ee285caee38631618437c140..4b7c5e0887cbd0ebe25cced2f278cbad8f0cf67d 100644 (file)
@@ -31,6 +31,11 @@ pub const FORCE_SEEK_OPTION: &str = "force_seek";
 /// Common description for forcing seek outside defined seekpoints.
 pub const FORCE_SEEK_OPTION_DESC: &str = "Allow seeking to arbitrary positions";
 
+/// Common name for forcing stream tag.
+pub const FORCE_STREAM_TAG_OPTION: &str = "stream_tag";
+/// Common description for forcing stream tag.
+pub const FORCE_STREAM_TAG_OPTION_DESC: &str = "Forced stream tag(s) in 'streamNtagHHHH' format";
+
 /// A list specifying option parsing and validating errors.
 #[derive(Clone,Copy,Debug,PartialEq)]
 pub enum OptionError {