Recherche avancée

Médias (0)

Mot : - Tags -/albums

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (72)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (7187)

  • Combine 2 mp3 files by using FFmpeg

    6 janvier 2016, par sajadmartiny

    I need to combine two mp3 files by using ffMpeg.
    I use this code, but it doesn’t work

    I want to execute this

    ffmpeg -i input1.mp3 -i input2.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 output.mp3

    Why isn’t my code working ?

    and my complete output log , problem Unknown encoder ’libmp3lame’

           01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   built on Oct  7 2014 15:05:17 with gcc 4.8 (GCC)
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libavutil      54.  7.100 / 54.  7.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libavcodec     56.  1.100 / 56.  1.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libavformat    56.  4.101 / 56.  4.101
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libavdevice    56.  0.100 / 56.  0.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libavfilter     5.  1.100 /  5.  1.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libswscale      3.  0.100 /  3.  0.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libswresample   1.  1.100 /  1.  1.100
    01-06 11:48:13.560 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   libpostproc    53.  0.100 / 53.  0.100
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout Input #0, mp3, from '/storage/emulated/0/a.mp3':
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   Metadata:
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     title           : Creep
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     album           : Pablo Honey
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     track           : 2/13
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     disc            : 1/1
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     artist          : Radiohead
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     genre           : Alternative
    -06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     publisher       : EMI Music Distribution
    -06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     album_artist    : Radiohead
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     composer        : Colin Greenwood/Ed O'Brien/Jonny Greenwood/Phil Selway/Thom Yorke
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     date            : 1993
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   Duration: 00:03:55.91, start: 0.025057, bitrate: 320 kb/s
    01-06 11:48:13.572 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    01-06 11:48:13.573 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     Metadata:
    01-06 11:48:13.573 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout       encoder         : LAME3.97
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout [mp3 @ 0x2b403a90] Estimating duration from bitrate, this may be inaccurate
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout Input #1, mp3, from '/storage/emulated/0/b.mp3':
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   Metadata:
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     title           : This is Love                  
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     artist          : Chirs de Burgh                
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     album           : This Way Up                  
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     date            : 1994
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     comment         :                              
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout   Duration: 00:03:47.67, start: 0.000000, bitrate: 128 kb/s
    01-06 11:48:13.577 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout     Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
    01-06 11:48:13.579 6119-6472/com.uraroji.garage.android.mp3recvoice D/test: shellout Unknown encoder 'libmp3lame'
    01-06 11:48:13.580 6119-6473/com.uraroji.garage.android.mp3recvoice D/dalvikvm: threadid=14: exiting
    01-06 11:48:13.580 6119-6473/com.uraroji.garage.android.mp3recvoice D/dalvikvm: threadid=14: bye!
    01-06 11:48:13.580 6119-6119/com.uraroji.garage.android.mp3recvoice D/test: processComplete 1
    01-06 11:48:13.580 6119-6472/com.uraroji.garage.android.mp3recvoice D/dalvikvm: threadid=13: exiting
    01-06 11:48:13.581 6119-6472/com.uraroji.garage.android.mp3recvoice D/dalvikvm: threadid=13: bye!
  • 7 Fintech Marketing Strategies to Maximise Profits in 2024

    24 juillet 2024, par Erin

    Fintech investment skyrocketed in 2021, but funding tanked in the following two years. A -63% decline in fintech investment in 2023 saw the worst year in funding since 2017. Luckily, the correction quickly floored, and the fintech industry will recover in 2024, but companies will have to work much harder to secure funds.

    F-Prime’s The 2024 State of Fintech Report called 2023 the year of “regulation on, risk off” amid market pressures and regulatory scrutiny. Funding is rising again, but investors want regulatory compliance and stronger growth performance from fintech ventures.

    Here are seven fintech marketing strategies to generate the growth investors seek in 2024.

    Top fintech marketing challenges in 2024

    Following the worst global investment run since 2017 in 2023, fintech marketers need to readjust their goals to adapt to the current market challenges. The fintech honeymoon is over for Wall Street with regulator scrutiny, closures, and a distinct lack of profitability giving investors cold feet.

    Here are the biggest challenges fintech marketers face in 2024 :

    • Market correction : With fewer rounds and longer times between them, securing funds is a major challenge for fintech businesses. F-Prime’s The 2024 State of Fintech Report warns of “a high probability of significant shutdowns in 2024 and 2025,” highlighting the importance of allocating resources and budgets effectively.
    • Contraction : Aside from VC funding decreasing by 64% in 2023, the payments category now attracts a large majority of fintech investment, meaning there’s a smaller share from a smaller pot to go around for everyone else.
    • Competition : The biggest names in finance have navigated heavy disruption from startups and, for the most part, emerged stronger than ever. Meanwhile, fintech is no longer Wall Street’s hottest commodity as investors turn their attention to AI.
    • Regulations : Regulatory scrutiny of fintech intensified in 2023 – particularly in the US – contributing to the “regulation on, risk off” summary of F-Prime’s report.
    • Investor scrutiny : With market and industry challenges intensifying, investors are putting their money behind “safer” ventures that demonstrate real, sustainable profitability, not short-term growth.
    • Customer loyalty : Even in traditional baking and finance, switching is surging as customers seek providers who better meet their needs. To achieve the sustainable growth investors are looking for, fintech startups need to know their ideal customer profile (ICP), tailor their products/services and fintech marketing campaigns to them, and retain them throughout the customer lifecycle.
    A tree map comparing fintech investment from 2021 to 2023
    (Source)

    The good news for fintech marketers is that the market correction is leveling out in 2024. In The 2024 State of Fintech Report, F-Prime says that “heading into 2024, we see the fintech market amid a rebound,” while McKinsey expects fintech revenue to grow “almost three times faster than those in the traditional banking sector between 2023 and 2028.”

    Winning back investor confidence won’t be easy, though. F-Prime acknowledges that investors are prioritising high-performance fintech ventures, particularly those with high gross margins. Fintech marketers need to abandon the growth-at-all-costs mindset and switch to a data-driven optimisation, growth and revenue system.

    7 fintech marketing strategies

    Given the current state of the fintech industry and relatively low levels of investor confidence, fintech marketers’ priority is building a new culture of sustainable profit. This starts with rethinking priorities and switching up the marketing goals to reflect longer-term ambitions.

    So, here are the fintech marketing strategies that matter most in 2024.

    1. Optimise for profitability over growth at all costs

    To progress from the growth-at-all-cost mindset, fintech marketers need to optimise for different KPIs. Instead of flexing metrics like customer growth rate, fintech companies need to take a more balanced approach to measuring sustainable profitability.

    This means holding on to existing customers – and maximising their value – while they acquire new customers. It also means that, instead of trying to make everyone a target customer, you concentrate on targeting the most valuable prospects, even if it results in a smaller overall user base.

    Optimising for profitability starts with putting vanity metrics in their place and pinpointing the KPIs that represent valuable business growth :

    • Gross profit margin
    • Revenue growth rate
    • Cash flow
    • Monthly active user growth (qualify “active” as completing a transaction)
    • Customer acquisition cost
    • Customer retention rate
    • Customer lifetime value
    • Avg. revenue per user
    • Avg. transactions per month
    • Avg. transaction value

    With a more focused acquisition strategy, you can feed these insights into every company level. For example, you can prioritise customer engagement, revenue, retention, and customer service in product development and customer experience (CX).

    To ensure all marketing efforts are pulling towards these KPIs, you need an attribution system that accurately measures the contribution of each channel.

    Marketing attribution (aka multi-touch attribution) should be used to measure every touchpoint in the customer journey and accurately credit them for driving revenue. This helps you allocate the correct budget to the channels and campaigns, adding real value to the business (e.g., social media marketing vs content marketing).

    Example : Mastercard helps a digital bank acquire 10 million high-value customers

    For example, Mastercard helped a digital bank in Latin America achieve sustainable growth beyond customer acquisition. The fintech company wanted to increase revenue through targeted acquisition and profitable engagement metrics.

    Strategies included :

    • A more targeted acquisition strategy for high-value customers
    • Increasing avg. spend per customer
    • Reducing acquisition cost
    • Customer retention

    As a result, Mastercard’s advisors helped this fintech company acquire 10 million new customers in two years. More importantly, they increased customer spending by 28% while reducing acquisition costs by 13%, creating a more sustainable and profitable growth model.

    2. Use web and app analytics to remotivate users before they disengage

    Engagement is the key to customer retention and lifetime value. To prevent valuable customers from disengaging, you need to intervene when they show early signs of losing interest, but they’re still receptive to your incentivisation tactics (promotions, rewards, milestones, etc.).

    By integrating web and app analytics, you can identify churn patterns and pinpoint the sequences of actions that lead to disengaging. For example, you might determine that customers who only log in once a month, engage with one dashboard, or drop below a certain transaction rate are at high risk for churn.

    Using a tool like Matomo for web and app analytics, you can detect these early signs of disengagement. Once you identify your churn risks, you can create triggers to automatically fire re-engagement campaigns. You can also use CRM and session data to personalize campaigns to directly address the cause of disengagement, e.g., valuable content or incentives to increase transaction rates.

    Example : Dynamic Yield fintech re-engagement case study

    In this Dynamic Yield case study, one leading fintech company uses customer spending patterns to identify those most likely to disengage. The company set up automated campaigns with personalised in-app messaging, offering time-bound incentives to increase transaction rates.

    With fully automated re-engagement campaigns, this fintech company increased customer retention through valuable engagement and revenue-driving actions.

    3. Identify the path your most valuable customers take

    Why optimise web experiences for everyone when you can tailor the online journey for your most valuable customers ? Use customer segmentation to identify the shared interests and habits of your most valuable customers. You can learn a lot about customers based on where the pages they visit and the content they engage with before taking action.

    Use these insights to optimise funnels that motivate prospects displaying the same customer behaviours as your most valuable customers.

    Get 20-40% more data with Matomo

    One of the biggest issues with Google Analytics and many similar tools is that they produce inaccurate data due to data sampling. Once you collect a certain amount of data, Google reports estimates instead of giving you complete, accurate insights.

    This means you could be basing important business decisions on inaccurate data. Furthermore, when investors are nervous about the uncertainty surrounding fintech, the last thing they want is inaccurate data.

    Matomo is the reliable, accurate alternative to Google Analytics that uses no data sampling whatsoever. You get 100% access to your web analytics data, so you can base every decision on reliable insights. With Matomo, you can access between 20% and 40% more data compared to Google Analytics.

    Matomo no data sampling

    With Matomo, you can confidently unlock the full picture of your marketing efforts and give potential investors insights they can trust.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    4. Reduce onboarding dropouts with marketing automation

    Onboarding dropouts kill your chance of getting any return on your customer acquisition cost. You also miss out on developing a long-term relationship with users who fail to complete the onboarding process – a hit on immediate ROI and, potentially, long-term profits.

    The onboarding process also defines the first impression for customers and sets a precedent for their ongoing experience.

    An engaging onboarding experience converts more potential customers into active users and sets them up for repeat engagement and valuable actions.

    Example : Maxio reduces onboarding time by 30% with GUIDEcx

    Onboarding optimisation specialists, GUIDEcx helped Maxio cut six weeks off their onboarding times – a 30% reduction.

    With a shorter onboarding schedule, more customers are committing to close the deal during kick-off calls. Meanwhile, by increasing automated tasks by 20%, the company has unlocked a 40% increase in capacity, allowing it to handle more customers at any given time and multiplying its capacity to generate revenue.

    5. Increase the value in TTFV with personalisation

    Time to first value (TTFV) is a key metric for onboarding optimisation, but some actions are more valuable than others. By personalising the experience for new users, you can increase the value of their first action, increasing motivation to continue using your fintech product/service.

    The onboarding process is an opportunity to learn more about new customers and deliver the most rewarding user experience for their particular needs.

    Example : Betterment helps users put their money to work right away

    Betterment has implemented a quick, personalised onboarding system instead of the typical email signup process. The app wants to help new customers put their money to work right away, optimising for the first transaction during onboarding itself.

    It personalises the experience by prompting new users to choose their goals, set up the right account for them, and select the best portfolio to achieve their goals. They can complete their first investment within a matter of minutes and professional financial advice is only ever a click away.

    Optimise account signups with Matomo

    If you want to create and optimise a signup process like Betterment, you need an analytics system with a complete conversion rate optimisation (CRO) toolkit. 

    A screenshot of conversion reporting in Matomo

    Matomo includes all the CRO features you need to optimise user experience and increase signups. With heatmaps, session recordings, form analytics, and A/B testing, you can make data-driven decisions with confidence.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    6. Use gamification to drive product engagement

    Gamification can create a more engaging experience and increase motivation for customers to continue using a product. The key is to reward valuable actions, engagement time, goal completions, and the small objectives that build up to bigger achievements.

    Gamification is most effective when used to help individuals achieve goals they’ve set for themselves, rather than the goals of others (e.g., an employer). This helps explain why it’s so valuable to fintech experience and how to implement effective gamification into products and services.

    Example : Credit Karma gamifies personal finance

    Credit Karma helps users improve their credit and build their net worth, subtly gamifying the entire experience.

    Users can set their financial goals and link all of their accounts to keep track of their assets in one place. The app helps users “see your wealth grow” with assets, debts, and investments all contributing to their next wealth as one easy-to-track figure.

    7. Personalise loyalty programs for retention and CLV

    Loyalty programs tap into similar psychology as gamification to motivate and reward engagement. Typically, the key difference is that – rather than earning rewards for themselves – you directly reward customers for their long-term loyalty.

    That being said, you can implement elements of gamification and personalisation into loyalty programs, too. 

    Example : Bank of America’s Preferred Rewards

    Bank of America’s Preferred Rewards program implements a tiered rewards system that rewards customers for their combined spending, saving, and borrowing activity.

    The program incentivises all customer activity with the bank and amplifies the rewards for its most active customers. Customers can also set personal finance goals (e.g., saving for retirement) to see which rewards benefit them the most.

    Conclusion

    Fintech marketing needs to catch up with the new priorities of investors in 2024. The pre-pandemic buzz is over, and investors remain cautious as regulatory scrutiny intensifies, security breaches mount up, and the market limps back into recovery.

    To win investor and consumer trust, fintech companies need to drop the growth-at-all-costs mindset and switch to a marketing philosophy of long-term profitability. This is what investors want in an unstable market, and it’s certainly what customers want from a company that handles their money.

    Unlock the full picture of your marketing efforts with Matomo’s robust features and accurate reporting. Trusted by over 1 million websites, Matomo is chosen for its compliance, accuracy, and powerful features that drive actionable insights and improve decision-making.

     Start your free 21-day trial now. No credit card required.

  • How can I fix a segmentation fault in a C program ? [duplicate]

    31 mars 2023, par ipegasus
    


    Possible Duplicate :
    
Segmentation fault

    


    


    Currently I am upgrading an open source program used for HTTP streaming. It needs to support the latest FFmpeg.
The code compiles fine without any warnings, although I am getting a segmentation fault error.

    


    How can I fix the issue ? And / or, what is the best way to debug ? Please find attached a portion of the code due to size. I will try to add the project to GitHub :)

    


    Sample Usage

    


    # segmenter --i out.ts --l 10 --o stream.m3u8 --d segments --f stream


    


    Makefile

    


    FFLIBS=`pkg-config --libs libavformat libavcodec libavutil`
FFFLAGS=`pkg-config --cflags libavformat libavcodec libavutil`

all:
    gcc -Wall -g segmenter.c -o segmenter ${FFFLAGS} ${FFLIBS}


    


    segmenter.c

    


    /*&#xA; * Copyright (c) 2009 Chase Douglas&#xA; *&#xA; * This program is free software; you can redistribute it and/or&#xA; * modify it under the terms of the GNU General Public License version 2&#xA; * as published by the Free Software Foundation.&#xA; *&#xA; * This program is distributed in the hope that it will be useful,&#xA; * but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&#xA; * GNU General Public License for more details.&#xA; *&#xA; * You should have received a copy of the GNU General Public License&#xA; * along with this program; if not, write to the Free Software&#xA; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&#xA; */&#xA;#include &#xA;#include &#xA;#include &#xA;#include &#xA;#include &#xA;#include "libavformat/avformat.h"&#xA;&#xA;#include "libavformat/avio.h"&#xA;&#xA;#include <sys></sys>stat.h>&#xA;&#xA;#include "segmenter.h"&#xA;#include "libavformat/avformat.h"&#xA;&#xA;#define IMAGE_ID3_SIZE 9171&#xA;&#xA;void printUsage() {&#xA;    fprintf(stderr, "\nExample: segmenter --i infile --d baseDir --f baseFileName --o playListFile.m3u8 --l 10 \n");&#xA;    fprintf(stderr, "\nOptions: \n");&#xA;    fprintf(stderr, "--i <infile>.\n");&#xA;    fprintf(stderr, "--o <outfile>.\n");&#xA;    fprintf(stderr, "--d basedir, the base directory for files.\n");&#xA;    fprintf(stderr, "--f baseFileName, output files will be baseFileName-#.\n");&#xA;    fprintf(stderr, "--l segment length, the length of each segment.\n");&#xA;    fprintf(stderr, "--a,  audio only decode for &lt; 64k streams.\n");&#xA;    fprintf(stderr, "--v,  video only decode for &lt; 64k streams.\n");&#xA;    fprintf(stderr, "--version, print version details and exit.\n");&#xA;    fprintf(stderr, "\n\n");&#xA;}&#xA;&#xA;void ffmpeg_version() {&#xA;    // output build and version numbers&#xA;    fprintf(stderr, "  libavutil version:   %s\n", AV_STRINGIFY(LIBAVUTIL_VERSION));&#xA;    fprintf(stderr, "  libavutil build:     %d\n", LIBAVUTIL_BUILD);&#xA;    fprintf(stderr, "  libavcodec version:  %s\n", AV_STRINGIFY(LIBAVCODEC_VERSION));&#xA;    fprintf(stdout, "  libavcodec build:    %d\n", LIBAVCODEC_BUILD);&#xA;    fprintf(stderr, "  libavformat version: %s\n", AV_STRINGIFY(LIBAVFORMAT_VERSION));&#xA;    fprintf(stderr, "  libavformat build:   %d\n", LIBAVFORMAT_BUILD);&#xA;    fprintf(stderr, "  built on " __DATE__ " " __TIME__);&#xA;#ifdef __GNUC__&#xA;    fprintf(stderr, ", gcc: " __VERSION__ "\n");&#xA;#else&#xA;    fprintf(stderr, ", using a non-gcc compiler\n");&#xA;#endif&#xA;}&#xA;&#xA;&#xA;static AVStream *add_output_stream(AVFormatContext *output_format_context, AVStream *input_stream) {&#xA;    AVCodecContext *input_codec_context;&#xA;    AVCodecContext *output_codec_context;&#xA;    AVStream *output_stream;&#xA;&#xA;    output_stream = avformat_new_stream(output_format_context, 0);&#xA;    if (!output_stream) {&#xA;        fprintf(stderr, "Segmenter error: Could not allocate stream\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    input_codec_context = input_stream->codec;&#xA;    output_codec_context = output_stream->codec;&#xA;&#xA;    output_codec_context->codec_id = input_codec_context->codec_id;&#xA;    output_codec_context->codec_type = input_codec_context->codec_type;&#xA;    output_codec_context->codec_tag = input_codec_context->codec_tag;&#xA;    output_codec_context->bit_rate = input_codec_context->bit_rate;&#xA;    output_codec_context->extradata = input_codec_context->extradata;&#xA;    output_codec_context->extradata_size = input_codec_context->extradata_size;&#xA;&#xA;    if (av_q2d(input_codec_context->time_base) * input_codec_context->ticks_per_frame > av_q2d(input_stream->time_base) &amp;&amp; av_q2d(input_stream->time_base) &lt; 1.0 / 1000) {&#xA;        output_codec_context->time_base = input_codec_context->time_base;&#xA;        output_codec_context->time_base.num *= input_codec_context->ticks_per_frame;&#xA;    } else {&#xA;        output_codec_context->time_base = input_stream->time_base;&#xA;    }&#xA;&#xA;    switch (input_codec_context->codec_type) {&#xA;#ifdef USE_OLD_FFMPEG&#xA;        case CODEC_TYPE_AUDIO:&#xA;#else&#xA;        case AVMEDIA_TYPE_AUDIO:&#xA;#endif&#xA;            output_codec_context->channel_layout = input_codec_context->channel_layout;&#xA;            output_codec_context->sample_rate = input_codec_context->sample_rate;&#xA;            output_codec_context->channels = input_codec_context->channels;&#xA;            output_codec_context->frame_size = input_codec_context->frame_size;&#xA;            if ((input_codec_context->block_align == 1 &amp;&amp; input_codec_context->codec_id == CODEC_ID_MP3) || input_codec_context->codec_id == CODEC_ID_AC3) {&#xA;                output_codec_context->block_align = 0;&#xA;            } else {&#xA;                output_codec_context->block_align = input_codec_context->block_align;&#xA;            }&#xA;            break;&#xA;#ifdef USE_OLD_FFMPEG&#xA;        case CODEC_TYPE_VIDEO:&#xA;#else&#xA;        case AVMEDIA_TYPE_VIDEO:&#xA;#endif&#xA;            output_codec_context->pix_fmt = input_codec_context->pix_fmt;&#xA;            output_codec_context->width = input_codec_context->width;&#xA;            output_codec_context->height = input_codec_context->height;&#xA;            output_codec_context->has_b_frames = input_codec_context->has_b_frames;&#xA;&#xA;            if (output_format_context->oformat->flags &amp; AVFMT_GLOBALHEADER) {&#xA;                output_codec_context->flags |= CODEC_FLAG_GLOBAL_HEADER;&#xA;            }&#xA;            break;&#xA;        default:&#xA;            break;&#xA;    }&#xA;&#xA;    return output_stream;&#xA;}&#xA;&#xA;int write_index_file(const char index[], const char tmp_index[], const unsigned int planned_segment_duration, const unsigned int actual_segment_duration[],&#xA;        const char output_directory[], const char output_prefix[], const char output_file_extension[],&#xA;        const unsigned int first_segment, const unsigned int last_segment) {&#xA;    FILE *index_fp;&#xA;    char *write_buf;&#xA;    unsigned int i;&#xA;&#xA;    index_fp = fopen(tmp_index, "w");&#xA;    if (!index_fp) {&#xA;        fprintf(stderr, "Could not open temporary m3u8 index file (%s), no index file will be created\n", tmp_index);&#xA;        return -1;&#xA;    }&#xA;&#xA;    write_buf = malloc(sizeof (char) * 1024);&#xA;    if (!write_buf) {&#xA;        fprintf(stderr, "Could not allocate write buffer for index file, index file will be invalid\n");&#xA;        fclose(index_fp);&#xA;        return -1;&#xA;    }&#xA;&#xA;    unsigned int maxDuration = planned_segment_duration;&#xA;&#xA;    for (i = first_segment; i &lt;= last_segment; i&#x2B;&#x2B;)&#xA;        if (actual_segment_duration[i] > maxDuration)&#xA;            maxDuration = actual_segment_duration[i];&#xA;&#xA;&#xA;&#xA;    snprintf(write_buf, 1024, "#EXTM3U\n#EXT-X-TARGETDURATION:%u\n", maxDuration);&#xA;&#xA;    if (fwrite(write_buf, strlen(write_buf), 1, index_fp) != 1) {&#xA;        fprintf(stderr, "Could not write to m3u8 index file, will not continue writing to index file\n");&#xA;        free(write_buf);&#xA;        fclose(index_fp);&#xA;        return -1;&#xA;    }&#xA;&#xA;    for (i = first_segment; i &lt;= last_segment; i&#x2B;&#x2B;) {&#xA;        snprintf(write_buf, 1024, "#EXTINF:%u,\n%s-%u%s\n", actual_segment_duration[i], output_prefix, i, output_file_extension);&#xA;        if (fwrite(write_buf, strlen(write_buf), 1, index_fp) != 1) {&#xA;            fprintf(stderr, "Could not write to m3u8 index file, will not continue writing to index file\n");&#xA;            free(write_buf);&#xA;            fclose(index_fp);&#xA;            return -1;&#xA;        }&#xA;    }&#xA;&#xA;    snprintf(write_buf, 1024, "#EXT-X-ENDLIST\n");&#xA;    if (fwrite(write_buf, strlen(write_buf), 1, index_fp) != 1) {&#xA;        fprintf(stderr, "Could not write last file and endlist tag to m3u8 index file\n");&#xA;        free(write_buf);&#xA;        fclose(index_fp);&#xA;        return -1;&#xA;    }&#xA;&#xA;    free(write_buf);&#xA;    fclose(index_fp);&#xA;&#xA;    return rename(tmp_index, index);&#xA;}&#xA;&#xA;int main(int argc, const char *argv[]) {&#xA;    //input parameters&#xA;    char inputFilename[MAX_FILENAME_LENGTH], playlistFilename[MAX_FILENAME_LENGTH], baseDirName[MAX_FILENAME_LENGTH], baseFileName[MAX_FILENAME_LENGTH];&#xA;    char baseFileExtension[5]; //either "ts", "aac" or "mp3"&#xA;    int segmentLength, outputStreams, verbosity, version;&#xA;&#xA;&#xA;&#xA;    char currentOutputFileName[MAX_FILENAME_LENGTH];&#xA;    char tempPlaylistName[MAX_FILENAME_LENGTH];&#xA;&#xA;&#xA;    //these are used to determine the exact length of the current segment&#xA;    double prev_segment_time = 0;&#xA;    double segment_time;&#xA;    unsigned int actual_segment_durations[2048];&#xA;    double packet_time = 0;&#xA;&#xA;    //new variables to keep track of output size&#xA;    double output_bytes = 0;&#xA;&#xA;    unsigned int output_index = 1;&#xA;    AVOutputFormat *ofmt;&#xA;    AVFormatContext *ic = NULL;&#xA;    AVFormatContext *oc;&#xA;    AVStream *video_st = NULL;&#xA;    AVStream *audio_st = NULL;&#xA;    AVCodec *codec;&#xA;    int video_index;&#xA;    int audio_index;&#xA;    unsigned int first_segment = 1;&#xA;    unsigned int last_segment = 0;&#xA;    int write_index = 1;&#xA;    int decode_done;&#xA;    int ret;&#xA;    int i;&#xA;&#xA;    unsigned char id3_tag[128];&#xA;    unsigned char * image_id3_tag;&#xA;&#xA;    size_t id3_tag_size = 73;&#xA;    int newFile = 1; //a boolean value to flag when a new file needs id3 tag info in it&#xA;&#xA;    if (parseCommandLine(inputFilename, playlistFilename, baseDirName, baseFileName, baseFileExtension, &amp;outputStreams, &amp;segmentLength, &amp;verbosity, &amp;version, argc, argv) != 0)&#xA;        return 0;&#xA;&#xA;    if (version) {&#xA;        ffmpeg_version();&#xA;        return 0;&#xA;    }&#xA;&#xA;&#xA;    fprintf(stderr, "%s %s\n", playlistFilename, tempPlaylistName);&#xA;&#xA;&#xA;    image_id3_tag = malloc(IMAGE_ID3_SIZE);&#xA;    if (outputStreams == OUTPUT_STREAM_AUDIO)&#xA;        build_image_id3_tag(image_id3_tag);&#xA;    build_id3_tag((char *) id3_tag, id3_tag_size);&#xA;&#xA;    snprintf(tempPlaylistName, strlen(playlistFilename) &#x2B; strlen(baseDirName) &#x2B; 1, "%s%s", baseDirName, playlistFilename);&#xA;    strncpy(playlistFilename, tempPlaylistName, strlen(tempPlaylistName));&#xA;    strncpy(tempPlaylistName, playlistFilename, MAX_FILENAME_LENGTH);&#xA;    strncat(tempPlaylistName, ".", 1);&#xA;&#xA;    //decide if this is an aac file or a mpegts file.&#xA;    //postpone deciding format until later&#xA;    /*    ifmt = av_find_input_format("mpegts");&#xA;    if (!ifmt)&#xA;    {&#xA;    fprintf(stderr, "Could not find MPEG-TS demuxer.\n");&#xA;    exit(1);&#xA;    } */&#xA;&#xA;    av_log_set_level(AV_LOG_DEBUG);&#xA;&#xA;    av_register_all();&#xA;    ret = avformat_open_input(&amp;ic, inputFilename, NULL, NULL);&#xA;    if (ret != 0) {&#xA;        fprintf(stderr, "Could not open input file %s. Error %d.\n", inputFilename, ret);&#xA;        exit(1);&#xA;    }&#xA;&#xA;    if (avformat_find_stream_info(ic, NULL) &lt; 0) {&#xA;        fprintf(stderr, "Could not read stream information.\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    oc = avformat_alloc_context();&#xA;    if (!oc) {&#xA;        fprintf(stderr, "Could not allocate output context.");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    video_index = -1;&#xA;    audio_index = -1;&#xA;&#xA;    for (i = 0; i &lt; ic->nb_streams &amp;&amp; (video_index &lt; 0 || audio_index &lt; 0); i&#x2B;&#x2B;) {&#xA;        switch (ic->streams[i]->codec->codec_type) {&#xA;&#xA;#ifdef USE_OLD_FFMPEG&#xA;            case CODEC_TYPE_VIDEO:&#xA;#else&#xA;            case AVMEDIA_TYPE_VIDEO:&#xA;#endif&#xA;                video_index = i;&#xA;                ic->streams[i]->discard = AVDISCARD_NONE;&#xA;                if (outputStreams &amp; OUTPUT_STREAM_VIDEO)&#xA;                    video_st = add_output_stream(oc, ic->streams[i]);&#xA;                break;&#xA;#ifdef USE_OLD_FFMPEG&#xA;            case CODEC_TYPE_AUDIO:&#xA;#else&#xA;            case AVMEDIA_TYPE_AUDIO:&#xA;#endif&#xA;                audio_index = i;&#xA;                ic->streams[i]->discard = AVDISCARD_NONE;&#xA;                if (outputStreams &amp; OUTPUT_STREAM_AUDIO)&#xA;                    audio_st = add_output_stream(oc, ic->streams[i]);&#xA;                break;&#xA;            default:&#xA;                ic->streams[i]->discard = AVDISCARD_ALL;&#xA;                break;&#xA;        }&#xA;    }&#xA;&#xA;    if (video_index == -1) {&#xA;        fprintf(stderr, "Stream must have video component.\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    //now that we know the audio and video output streams&#xA;    //we can decide on an output format.&#xA;    if (outputStreams == OUTPUT_STREAM_AUDIO) {&#xA;        //the audio output format should be the same as the audio input format&#xA;        switch (ic->streams[audio_index]->codec->codec_id) {&#xA;            case CODEC_ID_MP3:&#xA;                fprintf(stderr, "Setting output audio to mp3.");&#xA;                strncpy(baseFileExtension, ".mp3", strlen(".mp3"));&#xA;                ofmt = av_guess_format("mp3", NULL, NULL);&#xA;                break;&#xA;            case CODEC_ID_AAC:&#xA;                fprintf(stderr, "Setting output audio to aac.");&#xA;                ofmt = av_guess_format("adts", NULL, NULL);&#xA;                break;&#xA;            default:&#xA;                fprintf(stderr, "Codec id %d not supported.\n", ic->streams[audio_index]->id);&#xA;        }&#xA;        if (!ofmt) {&#xA;            fprintf(stderr, "Could not find audio muxer.\n");&#xA;            exit(1);&#xA;        }&#xA;    } else {&#xA;        ofmt = av_guess_format("mpegts", NULL, NULL);&#xA;        if (!ofmt) {&#xA;            fprintf(stderr, "Could not find MPEG-TS muxer.\n");&#xA;            exit(1);&#xA;        }&#xA;    }&#xA;    oc->oformat = ofmt;&#xA;&#xA;    if (outputStreams &amp; OUTPUT_STREAM_VIDEO &amp;&amp; oc->oformat->flags &amp; AVFMT_GLOBALHEADER) {&#xA;        oc->flags |= CODEC_FLAG_GLOBAL_HEADER;&#xA;    }&#xA;&#xA;&#xA;    /*  Deprecated: pass the options to avformat_write_header directly.&#xA;        if (av_set_parameters(oc, NULL) &lt; 0) {&#xA;            fprintf(stderr, "Invalid output format parameters.\n");&#xA;            exit(1);&#xA;        }&#xA;     */&#xA;&#xA;    av_dump_format(oc, 0, baseFileName, 1);&#xA;&#xA;&#xA;    //open the video codec only if there is video data&#xA;    if (video_index != -1) {&#xA;        if (outputStreams &amp; OUTPUT_STREAM_VIDEO)&#xA;            codec = avcodec_find_decoder(video_st->codec->codec_id);&#xA;        else&#xA;            codec = avcodec_find_decoder(ic->streams[video_index]->codec->codec_id);&#xA;        if (!codec) {&#xA;            fprintf(stderr, "Could not find video decoder, key frames will not be honored.\n");&#xA;        }&#xA;&#xA;        if (outputStreams &amp; OUTPUT_STREAM_VIDEO)&#xA;            ret = avcodec_open2(video_st->codec, codec, NULL);&#xA;        else&#xA;            avcodec_open2(ic->streams[video_index]->codec, codec, NULL);&#xA;        if (ret &lt; 0) {&#xA;            fprintf(stderr, "Could not open video decoder, key frames will not be honored.\n");&#xA;        }&#xA;    }&#xA;&#xA;    snprintf(currentOutputFileName, strlen(baseDirName) &#x2B; strlen(baseFileName) &#x2B; strlen(baseFileExtension) &#x2B; 10, "%s%s-%u%s", baseDirName, baseFileName, output_index&#x2B;&#x2B;, baseFileExtension);&#xA;&#xA;    if (avio_open(&amp;oc->pb, currentOutputFileName, URL_WRONLY) &lt; 0) {&#xA;        fprintf(stderr, "Could not open &#x27;%s&#x27;.\n", currentOutputFileName);&#xA;        exit(1);&#xA;    }&#xA;    newFile = 1;&#xA;&#xA;    int r = avformat_write_header(oc,NULL);&#xA;    if (r) {&#xA;        fprintf(stderr, "Could not write mpegts header to first output file.\n");&#xA;        debugReturnCode(r);&#xA;        exit(1);&#xA;    }&#xA;&#xA;    //no segment info is written here. This just creates the shell of the playlist file&#xA;    write_index = !write_index_file(playlistFilename, tempPlaylistName, segmentLength, actual_segment_durations, baseDirName, baseFileName, baseFileExtension, first_segment, last_segment);&#xA;&#xA;    do {&#xA;        AVPacket packet;&#xA;&#xA;        decode_done = av_read_frame(ic, &amp;packet);&#xA;&#xA;        if (decode_done &lt; 0) {&#xA;            break;&#xA;        }&#xA;&#xA;        if (av_dup_packet(&amp;packet) &lt; 0) {&#xA;            fprintf(stderr, "Could not duplicate packet.");&#xA;            av_free_packet(&amp;packet);&#xA;            break;&#xA;        }&#xA;&#xA;        //this time is used to check for a break in the segments&#xA;        //    if (packet.stream_index == video_index &amp;&amp; (packet.flags &amp; PKT_FLAG_KEY))&#xA;        //    {&#xA;        //    segment_time = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;&#xA;        //    }&#xA;#if USE_OLD_FFMPEG&#xA;        if (packet.stream_index == video_index &amp;&amp; (packet.flags &amp; PKT_FLAG_KEY))&#xA;#else&#xA;        if (packet.stream_index == video_index &amp;&amp; (packet.flags &amp; AV_PKT_FLAG_KEY))&#xA;#endif&#xA;        {&#xA;            segment_time = (double) packet.pts * ic->streams[video_index]->time_base.num / ic->streams[video_index]->time_base.den;&#xA;        }&#xA;        //  else if (video_index &lt; 0)&#xA;        //    {&#xA;        //        segment_time = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;&#xA;        //    }&#xA;&#xA;        //get the most recent packet time&#xA;        //this time is used when the time for the final segment is printed. It may not be on the edge of&#xA;        //of a keyframe!&#xA;        if (packet.stream_index == video_index)&#xA;            packet_time = (double) packet.pts * ic->streams[video_index]->time_base.num / ic->streams[video_index]->time_base.den; //(double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;&#xA;        else if (outputStreams &amp; OUTPUT_STREAM_AUDIO)&#xA;            packet_time = (double) audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;&#xA;        else&#xA;            continue;&#xA;        //start looking for segment splits for videos one half second before segment duration expires. This is because the&#xA;        //segments are split on key frames so we cannot expect all segments to be split exactly equally.&#xA;        if (segment_time - prev_segment_time >= segmentLength - 0.5) {&#xA;            fprintf(stderr, "looking to print index file at time %lf\n", segment_time);&#xA;            avio_flush(oc->pb);&#xA;            avio_close(oc->pb);&#xA;&#xA;            if (write_index) {&#xA;                actual_segment_durations[&#x2B;&#x2B;last_segment] = (unsigned int) rint(segment_time - prev_segment_time);&#xA;                write_index = !write_index_file(playlistFilename, tempPlaylistName, segmentLength, actual_segment_durations, baseDirName, baseFileName, baseFileExtension, first_segment, last_segment);&#xA;                fprintf(stderr, "Writing index file at time %lf\n", packet_time);&#xA;            }&#xA;&#xA;            struct stat st;&#xA;            stat(currentOutputFileName, &amp;st);&#xA;            output_bytes &#x2B;= st.st_size;&#xA;&#xA;            snprintf(currentOutputFileName, strlen(baseDirName) &#x2B; strlen(baseFileName) &#x2B; strlen(baseFileExtension) &#x2B; 10, "%s%s-%u%s", baseDirName, baseFileName, output_index&#x2B;&#x2B;, baseFileExtension);&#xA;            if (avio_open(&amp;oc->pb, currentOutputFileName, URL_WRONLY) &lt; 0) {&#xA;                fprintf(stderr, "Could not open &#x27;%s&#x27;\n", currentOutputFileName);&#xA;                break;&#xA;            }&#xA;&#xA;            newFile = 1;&#xA;            prev_segment_time = segment_time;&#xA;        }&#xA;&#xA;        if (outputStreams == OUTPUT_STREAM_AUDIO &amp;&amp; packet.stream_index == audio_index) {&#xA;            if (newFile &amp;&amp; outputStreams == OUTPUT_STREAM_AUDIO) {&#xA;                //add id3 tag info&#xA;                //fprintf(stderr, "adding id3tag to file %s\n", currentOutputFileName);&#xA;                //printf("%lf %lld %lld %lld %lld %lld %lf\n", segment_time, audio_st->pts.val, audio_st->cur_dts, audio_st->cur_pkt.pts, packet.pts, packet.dts, packet.dts * av_q2d(ic->streams[audio_index]->time_base) );&#xA;                fill_id3_tag((char*) id3_tag, id3_tag_size, packet.dts);&#xA;                avio_write(oc->pb, id3_tag, id3_tag_size);&#xA;                avio_write(oc->pb, image_id3_tag, IMAGE_ID3_SIZE);&#xA;                avio_flush(oc->pb);&#xA;                newFile = 0;&#xA;            }&#xA;&#xA;            packet.stream_index = 0; //only one stream in audio only segments&#xA;            ret = av_interleaved_write_frame(oc, &amp;packet);&#xA;        } else if (outputStreams &amp; OUTPUT_STREAM_VIDEO) {&#xA;            if (newFile) {&#xA;                //fprintf(stderr, "New File: %lld %lld %lld\n", packet.pts, video_st->pts.val, audio_st->pts.val);&#xA;                //printf("%lf %lld %lld %lld %lld %lld %lf\n", segment_time, audio_st->pts.val, audio_st->cur_dts, audio_st->cur_pkt.pts, packet.pts, packet.dts, packet.dts * av_q2d(ic->streams[audio_index]->time_base) );&#xA;                newFile = 0;&#xA;            }&#xA;            if (outputStreams == OUTPUT_STREAM_VIDEO)&#xA;                ret = av_write_frame(oc, &amp;packet);&#xA;            else&#xA;                ret = av_interleaved_write_frame(oc, &amp;packet);&#xA;        }&#xA;&#xA;        if (ret &lt; 0) {&#xA;            fprintf(stderr, "Warning: Could not write frame of stream.\n");&#xA;        } else if (ret > 0) {&#xA;            fprintf(stderr, "End of stream requested.\n");&#xA;            av_free_packet(&amp;packet);&#xA;            break;&#xA;        }&#xA;&#xA;        av_free_packet(&amp;packet);&#xA;    } while (!decode_done);&#xA;&#xA;    //make sure all packets are written and then close the last file.&#xA;    avio_flush(oc->pb);&#xA;    av_write_trailer(oc);&#xA;&#xA;    if (video_st &amp;&amp; video_st->codec)&#xA;        avcodec_close(video_st->codec);&#xA;&#xA;    if (audio_st &amp;&amp; audio_st->codec)&#xA;        avcodec_close(audio_st->codec);&#xA;&#xA;    for (i = 0; i &lt; oc->nb_streams; i&#x2B;&#x2B;) {&#xA;        av_freep(&amp;oc->streams[i]->codec);&#xA;        av_freep(&amp;oc->streams[i]);&#xA;    }&#xA;&#xA;    avio_close(oc->pb);&#xA;    av_free(oc);&#xA;&#xA;    struct stat st;&#xA;    stat(currentOutputFileName, &amp;st);&#xA;    output_bytes &#x2B;= st.st_size;&#xA;&#xA;&#xA;    if (write_index) {&#xA;        actual_segment_durations[&#x2B;&#x2B;last_segment] = (unsigned int) rint(packet_time - prev_segment_time);&#xA;&#xA;        //make sure that the last segment length is not zero&#xA;        if (actual_segment_durations[last_segment] == 0)&#xA;            actual_segment_durations[last_segment] = 1;&#xA;&#xA;        write_index_file(playlistFilename, tempPlaylistName, segmentLength, actual_segment_durations, baseDirName, baseFileName, baseFileExtension, first_segment, last_segment);&#xA;&#xA;    }&#xA;&#xA;    write_stream_size_file(baseDirName, baseFileName, output_bytes * 8 / segment_time);&#xA;&#xA;    return 0;&#xA;}&#xA;</outfile></infile>

    &#xA;