Source/MediaInfo/Video/File_AvsV.cpp
void File_AvsV::user_data_start()
{
    Element_Name("user_data_start");

    //Rejecting junk from the end
    size_t Library_End_Offset=(size_t)Element_Size;
    while (Library_End_Offset>0
        && (Buffer[Buffer_Offset+Library_End_Offset-1]<0x20
         || Buffer[Buffer_Offset+Library_End_Offset-1]>0x7D
         || (Buffer[Buffer_Offset+Library_End_Offset-1]>=0x3A
          && Buffer[Buffer_Offset+Library_End_Offset-1]<=0x40)))
        Library_End_Offset--;
    if (Library_End_Offset==0)
        return; //No good info

    //Accepting good data after junk
    size_t Library_Start_Offset=Library_End_Offset-1;
    while (Library_Start_Offset>0 && (Buffer[Buffer_Offset+Library_Start_Offset-1]>=0x20 && Buffer[Buffer_Offset+Library_Start_Offset-1]<=0x7D))
        Library_Start_Offset--;

    //But don't accept non-alpha caracters at the beginning (except for "3ivx")
    if (Library_End_Offset-Library_Start_Offset!=4 || CC4(Buffer+Buffer_Offset+Library_Start_Offset)!=0x33697678) //3ivx
        while (Library_Start_Offset<Library_End_Offset && Buffer[Buffer_Offset+Library_Start_Offset]<=0x40)
            Library_Start_Offset++;

    //Parsing
    Ztring Temp;
    if (Library_Start_Offset>0)
        Skip_XX(Library_Start_Offset,                           "junk");
    if (Library_End_Offset-Library_Start_Offset)
        Get_UTF8(Library_End_Offset-Library_Start_Offset, Temp, "data");
    if (Element_Offset<Element_Size)
        Skip_XX(Element_Size-Element_Offset,                    "junk");

    FILLING_BEGIN();
        //NextCode
        NextCode_Test();

        if (Temp.size()>=4)
            Library=Temp;
    FILLING_END();
}
//---------------------------------------------------------------------------
// Packet "B2", User defined size, this is often used of library name

Packet "B2", User defined size, this is often used of library name
Packet " B2 " User defined size this is often used of library name
void File_AvsV::user_data_start()
{
    Element_Name("user_data_start");
    size_t Library_End_Offset=(size_t)Element_Size;
    while (Library_End_Offset>0
        && (Buffer[Buffer_Offset+Library_End_Offset-1]<0x20
         || Buffer[Buffer_Offset+Library_End_Offset-1]>0x7D
         || (Buffer[Buffer_Offset+Library_End_Offset-1]>=0x3A
          && Buffer[Buffer_Offset+Library_End_Offset-1]<=0x40)))
        Library_End_Offset--;
    if (Library_End_Offset==0)
        return; 
    size_t Library_Start_Offset=Library_End_Offset-1;
    while (Library_Start_Offset>0 && (Buffer[Buffer_Offset+Library_Start_Offset-1]>=0x20 && Buffer[Buffer_Offset+Library_Start_Offset-1]<=0x7D))
        Library_Start_Offset--;
    if (Library_End_Offset-Library_Start_Offset!=4 || CC4(Buffer+Buffer_Offset+Library_Start_Offset)!=0x33697678) 
        while (Library_Start_Offset<Library_End_Offset && Buffer[Buffer_Offset+Library_Start_Offset]<=0x40)
            Library_Start_Offset++;
    Ztring Temp;
    if (Library_Start_Offset>0)
        Skip_XX(Library_Start_Offset,                           "junk");
    if (Library_End_Offset-Library_Start_Offset)
        Get_UTF8(Library_End_Offset-Library_Start_Offset, Temp, "data");
    if (Element_Offset<Element_Size)
        Skip_XX(Element_Size-Element_Offset,                    "junk");
    FILLING_BEGIN();
        NextCode_Test();
        if (Temp.size()>=4)
            Library=Temp;
    FILLING_END();
}
void File_AvsV :: user_data_start ( ) { Element_Name ( " " ) ; size_t Library_End_Offset = ( size_t ) Element_Size ; while ( Library_End_Offset > 0 && ( Buffer [ Buffer_Offset + Library_End_Offset - 1 ] < 0x20 || Buffer [ Buffer_Offset + Library_End_Offset - 1 ] > 0x7D || ( Buffer [ Buffer_Offset + Library_End_Offset - 1 ] >= 0x3A && Buffer [ Buffer_Offset + Library_End_Offset - 1 ] <= 0x40 ) ) ) Library_End_Offset -- ; if ( Library_End_Offset == 0 ) return ; size_t Library_Start_Offset = Library_End_Offset - 1 ; while ( Library_Start_Offset > 0 && ( Buffer [ Buffer_Offset + Library_Start_Offset - 1 ] >= 0x20 && Buffer [ Buffer_Offset + Library_Start_Offset - 1 ] <= 0x7D ) ) Library_Start_Offset -- ; if ( Library_End_Offset - Library_Start_Offset != 4 || CC4 ( Buffer + Buffer_Offset + Library_Start_Offset ) != 0x33697678 ) while ( Library_Start_Offset < Library_End_Offset && Buffer [ Buffer_Offset + Library_Start_Offset ] <= 0x40 ) Library_Start_Offset ++ ; Ztring Temp ; if ( Library_Start_Offset > 0 ) Skip_XX ( Library_Start_Offset , " " ) ; if ( Library_End_Offset - Library_Start_Offset ) Get_UTF8 ( Library_End_Offset - Library_Start_Offset , Temp , " " ) ; if ( Element_Offset < Element_Size ) Skip_XX ( Element_Size - Element_Offset , " " ) ; FILLING_BEGIN ( ) ; NextCode_Test ( ) ; if ( Temp . size ( ) >= 4 ) Library = Temp ; FILLING_END ( ) ; }
Packet "B2", User defined size, this is often used of library name
Packet " B2 " User defined size this is often used of library name
//Rejecting junk from the end
 //No good info
 //Accepting good data after junk
 //But don't accept non-alpha caracters at the beginning (except for "3ivx")
 //3ivx
 //Parsing
 //NextCode
